Repository navigation
fix(agents): reload the launchd agents after an upgrade; tests stop writing the real log - #15
Merged
Merged
Conversation
…riting the real log After `brew upgrade` (1.3.0 -> 1.3.1) launchd refused to start the agents from the replaced bundle: `job state = spawn failed`, `OS_REASON_CODESIGNING`, no log line. The backup watchdog and the image attach went silent, and buffer-guard kept running the old code. The cask said this could not happen. AgentRepair reloads them (`bootout` + `bootstrap`, retried): - when the app starts on a new version - Homebrew quits and reopens it for an upgrade - the agents that are safe to restart are reloaded; - any agent launchd cannot start is reloaded, by the app every few minutes and by the backup watchdog every 30. That covers gdrive-buffer without restarting a working mount: it is touched only once it has died. `drive-status` shows an `Agents:` line. Also: - Under XCTest the logger writes to a temporary directory. `swift test` appended lock messages and a "BACKUP FAILURE: ... test canary" line to the real cloudmachine.log, where it reads like an alarm. - The release passes the commit count as CM_BUILD_NUMBER; v1.3.1 got a date because git failed inside build-app, which now says why when it happens. - Cask, packaging README and README no longer claim agents start by themselves after an upgrade. Co-Authored-By: Claude Opus 5.5 <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.
The problem
After
brew upgradefrom 1.3.0 to 1.3.1, launchd stopped starting the agents from the replaced bundle (job state = spawn failed,last exit reason = OS_REASON_CODESIGNING, nothing in any log). The watchdog and image attach went silent.buffer-guardkept running the old code.The fix:
AgentRepairReloading is done with
bootout+bootstrap, retried.backup-health,gdrive-attach,buffer-guard.gdrive-bufferwithout restarting a working mount: it is touched only once it has died.drive-statusgets anAgents:line.Also
cloudmachine.log. Before this, aBACKUP FAILURE: … test canaryline, which reads like an alarm, and lock messages landed there. Checked: a fullswift testadds 0 lines.CM_BUILD_NUMBER. v1.3.1 got a date becausegitfailed insidebuild-app, which now says why when that happens.Checks
swift test329/0, lint passes,brew styleon the cask passes.bootout+bootstraprepair was done by hand on the production Mac: the agents start again and the mount stayed up.Merging releases 1.3.2 automatically.
🤖 Generated with Claude Code