Skip to content

fix(boot): boot deadline kills the zombie-park-forever path — fail loud + exit, let the supervisor restart (task #82) - #1858

Merged
joelteply merged 1 commit into
canaryfrom
fix/boot-deadline-no-zombie-park
Jul 6, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/boot-deadline-no-zombie-park

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

A parallel reliability audit confirmed the #82 zombie-park is worse than assumed: IPC_READY is a
process-global watch::Sender that is NOT dropped when the IPC thread panics/hangs before binding the
socket. So main's ipc_ready_rx.changed() never errors → it parks FOREVER with no socket, no exit, no
nonzero code — the "clean exit" the old comment promised never happens. Concrete triggers already in-tree: a
pre-bind panic!("failed to load model_registry"), or ANY hung module initialize() (inits run serially
with no per-module timeout — the airc-120s-hang class, generalized).

Fix: bound the ready-wait with a BOOT DEADLINE (tokio::time::timeout, default 300s — generous for a cold
model load, override via CONTINUUM_BOOT_DEADLINE_SECS). If the socket isn't bound in time, boot is wedged →
fail loud + libc::_exit(1) so the supervisor (launchd/systemd KeepAlive from #1853/#1854) restarts us
instead of an alive-but-deaf zombie. The changed()-err path now _exit(1)s too (was return Ok(()), which
masked a boot failure). Both paths eprintln! alongside tracing::error! because _exit skips the async
appender flush — the raw stderr write is what the operator actually sees.

LIVE-verified on this Mac: normal boot ready in ~36s (default 300s deadline, no false-positive); a 2s deadline
against the real boot exits(1) at ~2s with the fail-loud message visible. Reliability spine: fail loud, never
park. Credit: parallel reliability-audit agent.

Co-Authored-By: Claude Opus 4.8 [email protected]
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…ud + exit, let the supervisor restart (task #82)

A parallel reliability audit confirmed the #82 zombie-park is worse than assumed: `IPC_READY` is a
process-global `watch::Sender` that is NOT dropped when the IPC thread panics/hangs before binding the
socket. So `main`'s `ipc_ready_rx.changed()` never errors → it parks FOREVER with no socket, no exit, no
nonzero code — the "clean exit" the old comment promised never happens. Concrete triggers already in-tree: a
pre-bind `panic!("failed to load model_registry")`, or ANY hung module `initialize()` (inits run serially
with no per-module timeout — the airc-120s-hang class, generalized).

Fix: bound the ready-wait with a BOOT DEADLINE (`tokio::time::timeout`, default 300s — generous for a cold
model load, override via CONTINUUM_BOOT_DEADLINE_SECS). If the socket isn't bound in time, boot is wedged →
fail loud + `libc::_exit(1)` so the supervisor (launchd/systemd KeepAlive from #1853/#1854) restarts us
instead of an alive-but-deaf zombie. The changed()-err path now `_exit(1)`s too (was `return Ok(())`, which
masked a boot failure). Both paths `eprintln!` alongside `tracing::error!` because `_exit` skips the async
appender flush — the raw stderr write is what the operator actually sees.

LIVE-verified on this Mac: normal boot ready in ~36s (default 300s deadline, no false-positive); a 2s deadline
against the real boot exits(1) at ~2s with the fail-loud message visible. Reliability spine: fail loud, never
park. Credit: parallel reliability-audit agent.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 2965a79 into canary Jul 6, 2026
@joelteply
joelteply deleted the fix/boot-deadline-no-zombie-park branch July 6, 2026 05:02
joelteply added a commit that referenced this pull request Jul 6, 2026
…ut + loud aggregate (reliability audit #2/#3) (#1859)

runtime.initialize() `return Err`'d on the FIRST module that failed init — which skipped EVERY module after
it, then the caller (ipc/mod.rs) swallowed the error and bound the socket anyway → a silently half-booted
core where one early failure hid the rest and disabled everything downstream. And a single hung
`initialize()` stalled the whole loop + the socket bind (the airc-120s class, generalized).

Fix (well-thought-out, no blast-radius crash):
- Each module inits INDEPENDENTLY — a failure is recorded LOUDLY (`✗ X initialization FAILED`) and the loop
  keeps going, so the rest of the substrate still comes up.
- Each `initialize()` is wrapped in a 60s per-module deadline (`tokio::time::timeout`) — a wedged init is
  skipped + named (`✗ X init TIMED OUT`), not left to stall boot. 60s is a backstop, not a budget (inits are
  meant to be fast; heavy work is detached/tick-driven).
- On any failure, return the COMPLETE aggregate summary (`N/M modules FAILED … [list]`) — the caller logs it
  loud, so a degraded boot is fully visible instead of first-failure-only-then-silent.
- Not a blanket crash: the core still binds + serves (resilient to one optional module failing); the main.rs
  boot deadline (#1858) still backstops a failure that prevents socket bind entirely.

Verified: 26 runtime tests green; normal boot ~44s with all modules clean (no false degraded-summary), core
responsive. Credit: parallel reliability-audit agent. Reliability spine: startup foolproofing.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant