Skip to content

fix(inference): a stream whose own progress stalls on a lane that is delivering to others is starvation, not wedge evidence (card 2caa0de5) - #4480

Merged
joelteply merged 1 commit into
canaryfrom
fix/keepalive-stall-on-busy-lane-is-starvation
Sep 27, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/keepalive-stall-on-busy-lane-is-starvation

Conversation

@joelteply

@joelteply joelteply commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

A stream whose own progress stalls on a lane that is delivering to others is starvation, not wedge evidence (card 2caa0de5).

What happened (IntelMac, 2026-09-27, core log)

  • 21:15:35Z: a fresh lane after the 6th relaunch drain of the day.
  • 21:19:47 and 21:22:41: inference.decode.failed kind=keepalive_masked_no_progress. A request's stream kept carrying keepalive bytes while its own prefill or decode didn't advance for the idle window.
  • 21:22:11: serving.health ok=true via=real_work, and 21:22:26 ok=true via=slot_progress. The lane was delivering and progressing.
  • 21:23:11: via=real_turn_failures hits threshold 2 and relaunches, outranking every trust path. It was the 7th drain.

With 6 CPU slots, one request's prefill can sit behind the others' for its whole idle window while the engine works. At one build job the build was only 48% CPU (llama-server 305%, core 186%), so this is contention.

The fix

The never-started path in sse_stream already asks the right question: classify_never_started_timeout(ms_since_real_work, waited). If real work reached anyone during the wait, the result is Starved and nothing is stamped (the 2026-08-15 bench-hard-rs lesson). The keepalive-masked path skipped that question and stamped unconditionally, and now it asks it:

Test

The decision is the already table-tested pure classify_never_started_timeout (never_started_timeout_on_a_delivering_lane_is_starvation_not_wedge_evidence: delivering, quiet, never, boundary); its doc now names both uses. The wiring mirrors the never-started arm line for line. A stream-level test would read two process-globals (the failure counter and the last-real-work clock) and be order-dependent, so I didn't add one.

Not built locally: this node's deploy build holds the shared target. CI is the compile.

Docs: CONCURRENCY-STYLE-GUIDE. Siblings: #4468 (a condemned engine ends waits at their checkpoint), #4471 (the build cap).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…delivering to others is starvation, not wedge evidence (card 2caa0de5)

sse_stream stamped note_real_decode_failure for keepalive_masked_no_progress
unconditionally, and two stamps trip serving.health via=real_turn_failures,
which outranks the real_work and slot_progress trust paths. On the IntelMac on
2026-09-27 a fresh lane was relaunched 8 min after it started (21:23Z) while
health read ok via real_work (21:22:11) and slot_progress (21:22:26): with 6
CPU slots, one request's prefill sat behind the others' for its whole idle
window. That was the 7th relaunch drain of the day.

The never-started path already answers this with
classify_never_started_timeout(ms_since_real_work, waited): real work for
anyone within the wait = Starved, nothing stamped (the 2026-08-15 bench-hard-rs
lesson). The keepalive-masked path now asks the same question. Starved probes
inference.queue_starved {stalled: progress} and the turn still fails; a lane
that delivered nothing to anyone in the window still counts (#363 intact). The
classifier is the already table-tested pure function; its doc now names both
uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Fable read d5ff4d6: right, and it reuses the one classifier (classify_never_started_timeout on ms_since_real_work) instead of a second rule: a stalled stream on a lane that delivered real work to anyone within the idle window is starvation (inference.queue_starved), never a relaunch stamp. Word at green.

Non-blocking: the starved turn itself still fails. Under #4453's rule it could keep waiting at the checkpoint while the lane delivers, instead of throwing away the work already prefilled; worth a follow-up card.

@joelteply

Copy link
Copy Markdown
Contributor Author

Fable: APPROVED at d5ff4d6, 8/8 green.

@joelteply
joelteply merged commit 601131b into canary Sep 27, 2026
8 checks passed
@joelteply
joelteply deleted the fix/keepalive-stall-on-busy-lane-is-starvation branch September 27, 2026 21:48
joelteply added a commit that referenced this pull request Sep 28, 2026
…n (a checkpoint), bounded by the act's ceiling; only a lane that did nothing fails it (card 115f9a14)

IntelMac 2026-09-28 05:07Z (Cormac's read): a turn at 96% prefill failed at the 90 s idle bound
(keepalive_masked_no_progress) while the server prefilled slot 4's 2,048-token chunk every
~176 s. #4480 already stopped counting that as wedge evidence, but the turn still failed. Now
both the no-bytes timeout and the progress stall classify by the lane's last real work: a lane
that worked for anyone in the window is busy, the bound becomes a checkpoint
(inference.stream.busy_not_dead) and the stream waits on, up to the act's own 3x ceiling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
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