Repository navigation
A KV page switch the engine never answers is sampled before the engine is replaced (card 3913621a) - #5528
Conversation
…each child starts its own silence clock (Codex on #5528) engine_of(root, records, liveness, is_engine), pure: only a lane this node launched whose record names the root, alive as that exact incarnation (pid and OS start time) and still an engine, is sampled. A remote or secondary endpoint, a replaced engine, a reused pid, a legacy record with no start time, or two live claimants is refused with the reason. A sample is discarded if the incarnation changed while it ran. child_log keys the last-line clock by the child's pid and starts a fresh clock per sink, so an engine never inherits a predecessor's timing and an adopted (undrained) engine reads as unknown. Fixtures: only_the_engine_that_serves_the_endpoint_is_sampled (remote, other port, replaced, non-engine pid, legacy record, stale beside live, two live); a_new_sink_starts_its_own_silence_clock. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…; a sink's clock is retired only if it is still its own (Codex on #5528) settle(): a sampler that fails, times out or truncates removes its attempt file (macOS sample writes as it goes), and the directory is pruned on every outcome, so KEEP bounds failed captures too. child_log retires a pid's clock when its sink ends, only if the map still holds that sink's clock (Arc identity), so a replacement that reused the pid keeps its own. Fixtures: a_failed_sample_leaves_nothing_and_every_attempt_prunes; the clock test now retires the old clock (replacement kept) and the fresh one (gone). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…e is replaced (card 3913621a) enrico, 2026-10-27: a page restore got no answer for 90 s twice (08:27Z on 7d8bff696, 11:25Z on 741b0175b). Each ended in quarantine and a cold start for every mind, with nothing captured, so neither hang could say why. The 11:25Z engine's own log was silent from about 11:15Z. - continuum_host::stack_sample: the per-OS sampler, chosen at the module boundary (macOS `sample <pid> <s> -file <out>`, Linux `eu-stack -p <pid>`, Windows none). - inference::engine_stall::capture: verifies the live lane's recorded pid is still llama-server, samples it for 2 s through bounded_command (the kernel's one spawn path), writes the sample beside the engine's log keeping the newest 4, and reads how long the engine's stderr has been silent. - child_log records each sink's last-line time (silent_ms), and owns the engine's log path (llama_server_log); launch.rs and process.rs move to it, and process.rs's hand-rolled port parse moves to port_of_base_url. - turn_admission: an Uncertain page outcome raises inference.kv_page.stall_evidence (silent_ms, sample path or why none) before it returns, so before quarantine. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…each child starts its own silence clock (Codex on #5528) engine_of(root, records, liveness, is_engine), pure: only a lane this node launched whose record names the root, alive as that exact incarnation (pid and OS start time) and still an engine, is sampled. A remote or secondary endpoint, a replaced engine, a reused pid, a legacy record with no start time, or two live claimants is refused with the reason. A sample is discarded if the incarnation changed while it ran. child_log keys the last-line clock by the child's pid and starts a fresh clock per sink, so an engine never inherits a predecessor's timing and an adopted (undrained) engine reads as unknown. Fixtures: only_the_engine_that_serves_the_endpoint_is_sampled (remote, other port, replaced, non-engine pid, legacy record, stale beside live, two live); a_new_sink_starts_its_own_silence_clock. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…; a sink's clock is retired only if it is still its own (Codex on #5528) settle(): a sampler that fails, times out or truncates removes its attempt file (macOS sample writes as it goes), and the directory is pruned on every outcome, so KEEP bounds failed captures too. child_log retires a pid's clock when its sink ends, only if the map still holds that sink's clock (Arc identity), so a replacement that reused the pid keeps its own. Fixtures: a_failed_sample_leaves_nothing_and_every_attempt_prunes; the clock test now retires the old clock (replacement kept) and the fresh one (gone). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
a0c73d2 to
f3e3da1
Compare
|
PASS at f3e3da1. Final rebase changes only the already-reviewed #5530 test synchronization; sampler implementation matches reviewed a0c73d2. Endpoint selection now requires one live recorded engine incarnation, checks identity again after sampling, starts a fresh stderr clock per child and retires it without removing a replacement clock. Failed/partial samples are cleaned and retention is pruned on both outcomes. Regression fixtures cover endpoint mismatch, clock replacement and failed capture retention. Independently verified all checks pass or intentionally skip, including engine, core and grid. This adds bounded diagnostic evidence; it does not establish root-cause resolution of restore stalls or live adoption. Windows has no stack sampler on this path. |
…n or a line is not UTF-8 (card a6481313) (#5532) * An engine's stderr sink keeps draining when its file cannot be written or a line is not UTF-8 (card a6481313) child_log's own contract: "If the file cannot be written we keep draining and discard, and say so once". But pump() returned on the first write or open error, and lines() returned on the first line that was not UTF-8; either dropped the engine's stderr reader, so its log and the stall evidence's silent_ms (#5528) went dark for the rest of its life. - pump reads lines as bytes and decodes them lossily; only a read error (the child's stderr closing) ends it. - A failed open, write or rotation drops the file, says so once (serving.llama.log_sink_degraded), and keeps draining and discarding; it tries the file again every REOPEN_AFTER_LINES discarded lines and says when it recovers (serving.llama.log_sink_recovered). Tests (unix): a child writing 4000 non-UTF-8 lines into an unwritable sink runs to completion and the drain ends with it; non-UTF-8 output is logged with replacement characters and the lines after it are logged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * A reopened engine log counts the bytes it already holds; an unreadable length counts as full (Codex on #5532) Reopening after a failure (and after a rotation) set written=0, so repeated failures and reopens could grow one file past MAX_BYTES. open_counted reads the file's length on every open; an unreadable length is treated as full, so the next line rotates. Test: the directory is missing at first, a near-full log appears while the child pauses, the reopen counts it and rotates, and neither generation passes the cap. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Why
An engine that stops answering a KV page switch is quarantined and replaced. That's a full cold start for every mind on the node (cache reuse on enrico dropped from 0.80 to about 0.42 after restarts, 2026-10-27). Twice that day, nothing explained why the engine stopped. Plan path step 1 (Fast) and line 6 (every fast-path miss loud): the next hang should name its own cause.
The two hangs on enrico, 2026-10-27, both read from
inference.kv_page.action:status 0, 90053 ms, on 7d8bff696;status 0, 90039 ms, on 741b0175b.Both pins hang, so it isn't the engine version. The 11:25Z engine's own log (
llama-server-58057.log) is silent from about 11:15:06Z: task 25's prefill progress stopped at 34%, and task 320 had just launched. Nothing more was written until the replacement at 11:36Z, andserving.llama.log_sink_endednever fired. Whether it was blocked writing its log, waiting on a lock, or still computing, nothing captured.What
continuum_host::stack_sample: the per-OS sampler, chosen at the module boundary and never branched on in logic:sample <pid> <s> -file <out>;eu-stack -p <pid>;inference::engine_stall::capture(root):llama-server(a dead or reused pid is named, never sampled);bounded_command, so no new spawn site;child_log: records each sink's last-line time (silent_ms) and now owns the engine's log path (llama_server_log).launch.rsandprocess.rsbuilt that path by hand, and both move to it.process.rs's hand-rolled port parse moves to the existingport_of_base_url.turn_admission: anUncertainpage outcome raisesinference.kv_page.stall_evidence(silent_ms, the sample path or why there is none) before returning, so before the caller quarantines.Verified (enrico, 2026-10-27, head 3e875cb)
cargo test -p continuum-host --lib stack_sample: 1 passed. Run locally becausecontinuum-hostis a leaf crate (-j 1, niced).sample <pid of a sleep> 2 -file <out>exited 0 and wrote a full report (process, path, threads).derived-or-floor:reasons.continuum-engine(the capture, the prune test, the call site). enrico is serving and IntelMac's builds go to CI, so CI is that compile. I'll post its receipt at this head.New tests:
engine_stall::only_the_newest_samples_are_kept;engine_stall::an_endpoint_with_no_engine_is_named_not_sampled;stack_sample::a_sampler_names_its_process_and_where_the_sample_goes.Measured after deploy
Owner Cormac: the next
status 0page switch on any node carriesinference.kv_page.stall_evidencewith a sample file, plus the frame where the engine's threads sit.Seen, not changed here
child_log's module doc says the drain keeps reading and discards on a write failure, butpumpreturns on the first write error, which drops the reader. That doesn't stall the engine (it gets EPIPE), but its log andsilent_mswould go dark. I'll card it under me rather than widen this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE