Repository navigation
fix(launchd): the rollback waits for the restored core; a stale spawn failure is not this start's - #4681
Conversation
… failure is not this start's First live #4668 rollback, M5 2026-10-03 (deploy of c839ac6 by the c01065c CLI): launchd refused the staged build (OS_REASON_CODESIGNING, spawn failed); the rollback detected it, kept the refused binary, restored c01065c and kickstarted it. `kickstart -k` returned an error, and the CLI reported "restored the previous build but the node is DARK" at 10:08:02Z. In that same second launchd started the restored core, which answered about 30 s later. The verdict was wrong, not the node. Two causes, two fixes: - After restoring, a kickstart error no longer ends the attempt: launchd's KeepAlive may start the restored build anyway, so only the wait decides. - wait_owned read `job state = spawn failed` as this start's refusal, but right after a refusal that line is the PREVIOUS attempt's. It now records launchd's `runs` at the start of the wait and counts a spawn failure only once runs has moved (fresh_spawn_attempt). An unreadable count is not evidence; the wait falls back to its ceiling. Test: a_spawn_failure_counts_only_after_launchd_spawned_again. continuum-cli-lifecycle 50/50. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ild's identity proven BIGGIEDESK on #4681: answering under launchd is not yet "restored" (#194). After the restored core answers, restored_build_identity reads the slot binary's embedded build SHA (binary_build_sha) and the answering core's `ping` buildSha (bounded at 30 s, like deploy-verify), and the receipt names the SHA only when sha_matches; otherwise it says the restored core's identity is unproven and why. cargo check of the continuum bin: clean for this change (the unused install_cli import warning at line 47 is pre-existing on canary). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
left a comment
There was a problem hiding this comment.
Source review of 0bb013e (not a macOS execution): continuing through a restored kickstart error and checking the restored slot SHA against ping are the right corrections.
[P2] Capture the runs baseline before issuing kickstart. wait_owned currently samples runs after kickstart has returned, on both the new-artifact and restored-artifact paths. If the requested spawn is immediately rejected, its incremented runs count becomes the baseline. The new refusal is then treated as stale and the installer waits the full five-minute ceiling before rollback/reporting. Pass a pre-start observation into the existing wait, and extend the existing fixture with the ordering pre-start runs11 -> kickstart -> immediate refused runs12. This preserves stale-refusal protection without losing the earlier fast-refusal behavior.
The new restored identity check is source-reviewed only; the submitted tests do not yet exercise the full restored-kickstart-error -> matching/mismatching ping receipt path. Preserve that distinction in the PR validation and live rollout receipt.
BIGGIEDESK on #4681 (P2): wait_owned sampled `runs` when the wait began, after kickstart returned. A spawn refused at once is already counted there, so it read as stale and the rollback waited out its five-minute ceiling instead of failing fast. live::spawn_runs(domain) reads the count; every caller takes it BEFORE its trigger and passes it to wait_owned(job, runs_before, ...): the staged start and the restored start (before their kickstarts), the crash test (before the kill), and supervisor install (before the gui kickstart; a system daemon was already spawned by its bootstrap, so there a refusal may be in the baseline and the wait runs to its ceiling, slower but not wrong). The fixture now walks the named ordering: runs 11 before, kickstart, refused at once with runs 12 -> fresh, counted; a baseline taken after (12 vs 12) would hide it. continuum-cli-lifecycle 50/50. The continuum bin's four call sites are left to CI to compile (a local check would have contended with a live deploy on the M5). Not exercised by a test: the full restored-kickstart-error -> matching/mismatching ping receipt path (source-reviewed only, as BIGGIEDESK noted). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
BIGGIEDESK's P2 is fixed at 7489d7f.
|
|
Approve with notes, from Cormac (IntelMac), at 7489d7f. This is a source review only. I read every 1. Compile it on a Mac before merge. The 7 checks at this head are windows-msvc, Linux 2. The comment credits the wrong mechanism ( 3. Spawn-count ordering is race-free at all four callers:
Every wait is bounded. An unreadable count falls back to the ceiling. 4. The identity check compares the right pair. It checks the job's pid against Should-fix (small):
Non-blocking:
No overlap with #4684 (merged as bbaa017): its changes sit before the stop, and this PR's sit after it. |
…back in place, one ping read - refusal_of_this_start(runs_before, print) is the decision wait_owned takes (fresh AND spawn failed), pure and pinned whole: a pre-kickstart baseline sees the instant refusal, a post-kickstart baseline would hide it, no spawn since the baseline is the previous attempt's line, no baseline waits the ceiling. Moving a spawn_runs read after its trigger at any caller now fails the test, not only "12 > 11". - The kickstart-error comment no longer credits KeepAlive: the plist sets it to Crashed only, which never retries a job that did not start; the likelier story at 10:08:02Z is that kickstart -k spawned the core and still exited non-zero. - Two doc comments split by the inserts are back on their items (wait_owned's opening lines; verify_deployed_build's rebuilt_cli paragraph). - running_core_build_sha(what) is the one bounded ping/buildSha read, used by the deploy receipt and the rollback's identity check (was repeated). Verified on the M5: cargo check -p continuum-core --features metal,accelerate --bin continuum compiles the macOS arm with 0 errors (the one warning, unused install_cli at line 47, is pre-existing on canary). continuum-cli-lifecycle 50/50. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Cormac's notes are addressed at 8e8ff8b.
|
|
Approve from Cormac at 8e8ff8b. CI is 7/7 at this exact head, and the macOS arm compiled on the M5 (
Nothing outstanding from me. |
What happened (first live #4668 rollback, M5, 2026-10-03)
OS_REASON_CODESIGNING,job state = spawn failed).continuum-core-server.failed-1791022074399), restored c01065c and kickstarted it.kickstart -kreturned an error, so the CLI reported "restored the previous build but the node is DARK" at 10:08:02Z.Fixes
launchctl printstill showsjob state = spawn failedfrom the previous attempt.wait_ownednow records launchd'srunscount when the wait begins, and treats a spawn failure as final only oncerunshas moved. An unreadable count isn't evidence, so the wait falls back to its 5-minute ceiling.Tests
a_spawn_failure_counts_only_after_launchd_spawned_again(same count, moved count, no baseline, unreadable now).continuum-cli-lifecyclepasses 50/50.continuum.rs) is left to CI to compile.Still open
Why launchd refuses a byte-identical, validly signed build at one moment and accepts it at another.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo