Repository navigation
fix(boot): boot deadline kills the zombie-park-forever path — fail loud + exit, let the supervisor restart (task #82) - #1858
Merged
Conversation
…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
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]>
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.
A parallel reliability audit confirmed the #82 zombie-park is worse than assumed:
IPC_READYis aprocess-global
watch::Senderthat is NOT dropped when the IPC thread panics/hangs before binding thesocket. So
main'sipc_ready_rx.changed()never errors → it parks FOREVER with no socket, no exit, nononzero 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 moduleinitialize()(inits run seriallywith 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 coldmodel 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 usinstead of an alive-but-deaf zombie. The changed()-err path now
_exit(1)s too (wasreturn Ok(()), whichmasked a boot failure). Both paths
eprintln!alongsidetracing::error!because_exitskips the asyncappender 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