Repository navigation
fix(updater): keep a confirmed worker's next update from rolling back - #10
Merged
Merged
Conversation
The supervisor decided once, when it started a child, whether that child was an update candidate. A candidate that confirmed its startup and later applied the next update (exit 75) was still treated as unconfirmed, so every second update rolled back with "New version exited before becoming healthy (exit 75)". The candidate is now tracked by its update command id.
nixuuu
added a commit
that referenced
this pull request
Nov 3, 2026
Standalone worker and gateway binaries run a resident supervisor that was never replaced: it kept the code of whatever version systemd started. On production it ran pre-#10 code for hours, so every second automatic update rolled back with "exit 75" until a manual restart. Now, after a confirmed update, the supervisor asks the healthy child over IPC to hand over; the child uses the existing idle/drain mechanics (never interrupts work), exits with 76, and the supervisor `process.execve`s the installed binary, keeping its PID (systemd/launchd need no changes). Unconfirmed candidates keep the rollback watchdog; no hand-over on rollback, on execve failure (logged, keeps running) or on Windows/without execve; a supervisor already matching the binary does nothing (no loops). Children under an older supervisor without IPC are unaffected. Docker, source and desktop installs are unchanged. Tests: real compiled binaries A → B → C replace the supervisor code with the same PID; rollback, active work, replacement races, startup mismatch, no restart loop, execve failure. check:tmp 683 pass / 0 fail. Supervisors started before this version need one manual restart to load it.
nixuuu
added a commit
that referenced
this pull request
Nov 12, 2026
The chained-update watchdog test intermittently exposed an empty or partially written `.update.json` through shell `>` redirection. CI run 43270195463, attempt 2, failed with `SyntaxError: Unexpected EOF` in `readUpdateRecord`. The production writer has used a private temporary file, file `fsync`, and atomic rename since its introduction; the failing fixture bypassed it. The v2 and v3 fixtures now call the real `confirmStartup` and `stageBinaryUpdate` APIs. A deterministic write barrier pauses the real confirmation writer after half its bytes and checks that readers still see the previous pending record, then the complete confirmation. A torn authoritative JSON regression checks that corruption remains an error. No read retries or updater/protocol behavior changes are needed for this failure. The frozen update protocol is untouched. Validation: Bun 1.4.4; `bun install --frozen-lockfile`; 10 consecutive separate executions of `TMPDIR=/var/tmp nice -n 19 bun test packages/updater/src/binary.test.ts` (8 tests each, 80 passes, 0 failures, about 4 seconds total); repository-wide `bun run lint` and `bun run format:check`; `git diff --check`. Generation, typecheck, the full test/temp checks, and builds are left to CI under the local verification constraints. CI repetition is pending. History: #10 introduced the shell fixture; this test-only correction uses `Related:` so it does not trigger a release/promotion hold. Related: #10 Related: #582
This was referenced Nov 13, 2026
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.
After a gateway update the worker showed Failed — New version exited before becoming healthy (exit 75); clicking Update worker then worked.
The supervisor (
superviseBinary) decided once, when it spawned a child, whether that child was an update candidate. A candidate that confirmed its startup and later applied the next update (writing a newrestartingrecord and exiting 75) was still treated as an unconfirmed candidate, so its restart request was rolled back — every second update failed. The candidate is now tracked by the update'scommandId: only a child that never confirmed its own update is rolled back; a confirmed child's exit 75 is a normal restart.New updater test reproduces it (fails before the change, passes after);
updatesintegration tests and typecheck pass.Note: the running supervisor is the binary loaded when the service started, so installs pick this up after the worker service restarts once on a fixed version.