ci(deploy): preempt self-update timer so it can't starve the deploy lock#72
Merged
Conversation
The self-update systemd timer redeploys from source (no SKIP_BUILD) and can hold setup.sh's flock for >5min while compiling on a tiny droplet. When it fires close to a CI push it starves the deploy, which waits the full 5min on the lock and then fails with 'another setup.sh run is in progress (lock held >5m)'. The CI push is authoritative (ships prebuilt binaries + resets to the exact commit), so stop any in-flight timer run to release the lock and pause the timer before taking it. setup.sh re-enables the timer at the end of its run. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
TestWebSaveOverQuotaPreservesExistingFile set quota=5 but left sess.used at the newSession baseline, which already counts the README.txt that ensureUserPub seeds into /public (added in d19c5c4). That baseline alone exceeds 5 bytes, so the initial 2-byte save was rejected with 'quota exceeded' before the test could exercise the over-quota replace. Reset sess.used to 0 after setting the tiny quota, mirroring TestQuotaEnforced, so the writer starts from a clean gauge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
Run 28503235083 failed at Provision / redeploy (idempotent, SKIP_BUILD=1) with:
Root cause
setup.shserializes runs with an exclusiveflock -w 300on/var/lock/agentbbs-setup.lock. The autonomousagentbbs-update.timerrunsself-update.sh, which redeploys from source (it does not passSKIP_BUILD=1). When the timer fires close to a push, itsgo buildon the tiny droplet holds the lock for longer than 5 minutes, so the CI deploy (which does setSKIP_BUILD=1) waits the full 300s on the lock and then dies.Fix
The CI push is authoritative — it ships runner-built binaries and
reset --hards to the exact pushed commit. So before taking the lock, stop any in-flight timer run (releasing the lock) and pause the timer so it can't re-fire mid-deploy:setup.shre-enables the timer at the end of its run (§7b), so no separate restart is needed. Safe because the CI script already does its ownreset --hardbefore callingsetup.sh, so a preempted timer build leaves nothing behind.🤖 Generated with Claude Code