Repository navigation
Conversation
ashhart
force-pushed
the
lead/stall-sentinel-keepalive
branch
3 times, most recently
from
November 14, 2026 20:11
99dba4c to
a74d931
Compare
This was referenced Nov 15, 2026
ashhart
force-pushed
the
lead/stall-sentinel-keepalive
branch
from
November 17, 2026 21:50
a74d931 to
e40e9af
Compare
8 tasks done
ashhart
force-pushed
the
lead/stall-sentinel-keepalive
branch
4 times, most recently
from
November 23, 2026 21:46
7775abd to
7dcfb9f
Compare
…l-exit restarts it (#3112)
…ine root too On macOS the server's core import is zig/src/tensorfold.zig, which re-exports core's files one by one, so @import("core").stall_timeout compiled on CUDA and Linux but not in the Metal build. tensorfold.zig now re-exports it as well.
Use the supplied paired backend/sentinel scope in the extracted lane loop, and let the shared idle helper close either scope shape before main weight release and idle waits.
ashhart
force-pushed
the
lead/stall-sentinel-keepalive
branch
from
November 26, 2026 22:24
7dcfb9f to
c13d3d4
Compare
This branch has not been deployed
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.
Closes #3112.
A lane-host engine that stops making progress (a hung device call, a lost peer) kept answering
/health200 while every request waited. New opt-in flags:--stall-seconds Nwatches each round on the shared lane host. A round in flight longer than N seconds marks the engine unavailable:/healthreturns 503, new requests get 503, andtensorfold_engine_stalls_totalcounts it.--stall-exitalso exits the process with status 70, so a supervisor restarts it. The exit skips atexit handlers, so nothing waits on the stalled device.Idle waits are outside the round scope, so idle time never counts as a stall, and idle unload isn't triggered by the status read. With the flag off, the cost is one atomic load per round and per submit, and the metrics output is unchanged. SSE keep-alives already exist (
: keepaliveon OpenAI streams,pingon Messages) and are unchanged. Flash Next on Metal, LFM2 and drama don't use the shared lane host, and they refuse the flag by name.Known limit, documented and tested: a family that fills a long prompt in one call holds one round for it, so N must exceed the slowest such call. With
--stall-exit, an N set too low restarts a healthy server.Tests:
test-lane-stall-host28 + 25;test-lane-api-host601;test-server-cpu1343 pass, 7 skip;test-dsv41-device-host221 pass, 2 skip; a forked-process test that--stall-exitends with status 70. The new tests use APIs main doesn't have.Device check pending (GB10 and a Mac lane-host family): flag off, metrics and replies byte-equal to main; with
--stall-seconds 120at 1 and 4 streams, tokens equal, decode level,/health200 and no stalls through long prompts.