mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1527] serve: the engine READY read times out and the engine is killed, but the pending request is still held (0.1.40.3) #615
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#615
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @justxiami on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1527
Summary
The read timeouts that 0.1.40.2 took from #1317 do bound the engine
READYread (the hung engine gets killed), but the request turn is not released: the client gets no response and the server prints no reason. Tested on a pristinev0.1.40.3checkout, so this is not a merge artifact of my tree.The same server does fail cleanly in the neighbouring case — engine already
READY, then silent during a request: HTTP 503 with a clear message afterengine_silence_s. So the gap is specific to "the engine is alive but never reports READY".This is a serve-only finding: no GPU, no model, no engine binary is needed to reproduce.
What 0.1.40.2 fixed, and what is left
From #1317 (still open), and @Niko1221's reply: "0.1.40.2 takes the read timeouts: the engine's READY read now gives up after 900 s, and the image encoder's READY and ENC reads after 300 s each … A process that says nothing for that long is killed, the request fails with a clear message and the next one starts it again."
Measured on 0.1.40.3 (both claims tested, same machine, same fake processes,
STRATA_ENGINE_READY_S=8,engine_silence_s=60in the config):READY(load path)curlreportscode=000; the server prints nothing containingdid not report READY(0 hits)RuntimeError: the vision encoder did not start: it said nothing for 8 s(serve/server.py:1716)READY, then silent mid-requestthe engine said nothing for 61 s during the request; the server ended the engine; the next request restarts itSo "killed" is delivered, "the request fails with a clear message" is not delivered in the first row.
Reproduction (no GPU, no model, no engine build)
READY:A config that points
exeat it (any existing serve config works;visionremoved,logandcwdpointed at a scratch dir).Start serve with
--lazyso the port is bound before any loading, then send one request:Expected (the patch's promise): the request ends with a clear failure. Actual: the request never returns (curl gives
000 130.00 s), the server's stdout stops atand nothing more. The fake engine is gone by the first status check after the timeout, so the
READYread did give up.The control arm (the second row above) is the same script with this fake engine instead:
That one returns 503 with the reason in 61.14 s.
Why the existing watchdogs do not cover it
engine_silence_s(#481) is armed after the request has been handed to the engine; here the blocking read never returns before the request is armed. #1317's own report says this.ENGINE_STALL_S,_cpu_flat_for,_cpu_seconds,_frozen(,gen_active,last_line_at). A pristinev0.1.40.3serve/server.pyhas 0 occurrences of all six, so that half of the patch was not taken. (Not the cause of the row-1 gap — theREADYtimeout does fire — but it is the reason nothing else notices a load that never completes.)What I did not determine
I did not localise which wait keeps the request thread. The
READYtimeout raisesRuntimeError,restart()catches it and retries (RESTART_RETRY_S), re-raising only on the last try — yet no retry line ("the engine did not start (try i of N)") is printed in this scenario, and the client socket stays open with no bytes. Also untested: whether the same holds without--lazy(in that case the port is never bound at all, so a client cannot even connect — during a cold-start hang the server offers nothing, which is arguably a separate symptom).What I would want
Once the
READYread times out and the engine has been killed, the load attempt should fail the pending request the same way the #481 path does — 503 plus the reason the server already computed — and let the next request start a new engine, instead of holding that turn open.Environment
v0.1.40.3tree (serve/server.pymd5c7a94436b69f) and, as a second arm, a 0.1.40.1-based serve carrying the three #1317 commits merged by hand (md59b690b1249a7). Same result in both.--layer-split 12,24,36in the config used for the arms (irrelevant: the engine is a stub).serve/server.pyis started.@justxiami commented on GitHub (Oct 8, 2026):
Evidence 1 of 2 — the scripts that ran, verbatim
Script comments are in Chinese; the code is exactly what ran. My absolute paths are left as-is; only
serve/server.py,--config,--portand the config'sexefield matter here.Provenance of the
servefiles:v0.1.40.3(codeloadtarball 17,049,420 B, sha256 prefixa91cca637dc910a8, 2598 entries,project(strata VERSION 0.1.40.3))serve/server.pyc7a94436b69fsrc/serve/server.py9b690b1249a7src/serve/server.py2b640a00dad3Every drill starts
serveon port 8098 or 8099 with a stubexe, never runs the engine binary, and ends with a residual check (production :8095 listener = 1, stub processes = 0). No GPU work happens in these arms: the stub exits onTERM.stub engine that starts and never reports READY (
exeoverride)stub engine that reports READY once, then never answers again
the config used (drill B1; per-arm differences are only
exe,logand — in the READY-then-silent arms —"engine_silence_s": 60;visionis removed)The
argslist is irrelevant here: the engine is a stub that never reads a byte of it.drill B1 — pristine v0.1.40.3 serve, request-triggered load (
--lazy), engine never reports READYdrill A6 — same scenario against my build,
curlallowed 320 s (past the defaultengine_silence_s= 300)Same shape as drill B1; the differences are
SERVE=pointing at my tree'ssrc/serve/server.py(nocdinto the 40.3 tree),curl -m 320instead of-m 130, and 17 poll iterations instead of 7.drill B2 — the control scenario (#1317's own description: engine
READY, then silent mid-request), both serve files side by side, same machine, same config, same stub@justxiami commented on GitHub (Oct 8, 2026):
Evidence 2 of 2 — the logs, verbatim
The three transcripts are re-runs of the same three drills on the same host, 2026-10-08 17:43–17:53 (UTC+8), captured with
tee; the earlier runs (16:36–17:31) produced the same numbers. Poll lines are one check every 20 s:fake engine = nonemeans the stub process no longer exists (killed by theREADYtimeout),serve = alivemeans the serve process is still up and still holding the client connection,lines= how many lines serve has printed.A6 — my build (
9b690b1249a7): request-triggered load, stub never says READY,STRATA_ENGINE_READY_S=8,curl -m 320Stub gone by the first poll; serve stdout frozen at 8 lines for the whole 320 s; the client gets nothing:
code=000 320.002542 s. Grep for the reason string the 0.1.40.2 notes promise (did not report READY): 0 occurrences.B1 — pristine v0.1.40.3 serve (
c7a94436b69f): same scenario,curl -m 130code=000 130.002547 s, same frozen 8-line serve output, same 0 occurrences. The "Killed" line at the end is the drill's ownkillof the serve process, not the server exiting.B2 — control scenario: stub prints
READY 32768 stopthen never answers,engine_silence_s=60in the config, both serve files back to back61.144866 s vs 61.144695 s, identical 503 body, identical serve transcript. That half of the fix is present and working in 0.1.40.3 — which is why the difference in the two transcripts above is not a merge artifact of my tree.
Engine-side logs for the three arms (whole file; the stub wrote one line at start and nothing else):
for contrast: the vision encoder arm of the same read timeout does fail with a message (my build, stub encoder that says nothing)
The engine
READYread has no equivalent of thisRuntimeErrorpath: when it times out, the pending request is not failed with a reason — it is just held.@Niko1221 commented on GitHub (Oct 10, 2026):
Fixed in v0.1.42 through #1588: when the engine's READY read times out, the request that was waiting on the load now ends with a 503 that says the engine did not report READY, and the next request restarts it. The lazy first start also no longer fails in restart() for a missing slot_cv.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.