mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#539
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 @btc1000w on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1317
Summary
On v0.1.40.1 (engine 0.1.40), running Qwen3.8-Flash-Next IQ3_XXS, the server intermittently hangs after it has been serving requests for a while: the current request stops progressing (the panel shows "waiting for token generation") and every later request stays "queued" forever. The engine is not stuck -- it is idle in its command loop; the server simply never finishes the request, so it never releases the single request turn.
Environment
--vision,--kv int8,--spec 4,--prefill auto:32768,--max-context 262144,--pipeline-windows 2, noparallel(1 request at a time).Observed
readingwithgenerated: 0, while the engine log already shows the request finished (e.g.prompt 56959 tokens ... 490 generated ... drafts accepted 366 of 369). The server never reads the end of the request.strata.exeCPU time is frozen (e.g. pinned at308.4375 sacross repeated samples) -- it is idle waiting for a command, not spinning. Because of that the engine-side #29 watchdog (which only counts while a request is running) never fires./statusshowsbusy:false, queued:Nwhile the UI still reports a running/queued request.Root cause
This is the #481 "lost step" class, with a concrete trigger: the server has blocking reads of the engine/vision pipes that have no timeout. If one of them never returns (the vision encoder's
READY/ENCread, or the engine'sREADYread), the request turn is held forever. By then the engine has already finished (or never saw the request), so no engine-side watchdog can fire and the request never ends; later requests queue behind it.Upstream's
engine_silence_s(v0.1.37, #481) covers a running request that goes silent, but it is armed only after the request has been sent to the engine -- it does not cover a blocking read that never returns before the request is armed.Fix (patch below)
Time out every blocking read and add a watchdog that can end a genuinely silent engine:
VISION_READY_S=300,VISION_ENCODE_S=300-- the vision-encoder reads go throughVision._readline(timeout, what)(a pump thread + queue); on timeout the encoder is killed and the request fails cleanly instead of hanging.ENGINE_READY_S=900-- the engineREADYread goes through a_ready_pumpthread +queue.get(timeout=...).ENGINE_STALL_S(default 90 s, override withSTRATA_ENGINE_STALL_S; 0 disables) -- while a request is active, if the engine prints nothing and its CPU time has not advanced, the engine is ended so the next request restarts it.FIFO_WARN_S=600-- a one-shot diagnostic line if a request holds the turn that long.TurnLockwrapper that records how long the turn has been held.All of these are server-side only; no engine rebuild is needed.
Evidence
strata.exeCPU frozen at308.4375 s,/statusstate="reading",elapsed_s=462.8,in_flight=2, while the engine log showed the request already completed.serve/test_server.py(204 tests) plus the companion tests pass; a 9-request stress run (image/vision + a 35k-token prompt + back-to-back + concurrent) and a ~10 min soak (three.js generation, 6 rounds) all completed with no hang.Relation to existing issues
Patch
strata-hang-fix.patch(15 hunks, +230 / -16) -- apply toserve/server.py.@Niko1221 commented on GitHub (Oct 7, 2026):
Thanks for the reproduction and the patch. 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 (STRATA_ENGINE_READY_S, STRATA_VISION_READY_S and STRATA_VISION_ENCODE_S change them; 0 waits for ever). A process that says nothing for that long is killed, the request fails with a clear message and the next one starts it again, so those reads can no longer hold the turn forever. You are credited in the commit. The 90 s watchdog that ends an engine whose output and CPU time stand still is not in this release: a long model load or a slow disk needs a careful look first. This issue stays open for it (and for #481).
@Niko1221 commented on GitHub (Oct 8, 2026):
Part 2 is in 0.1.41, server side. While a request is outstanding and the engine prints nothing for 90 s, the server samples the engine process: if it has used no CPU time and moved no disk bytes in that time and the GPU is not busy, it is frozen, the server ends it and the next request starts it again. An engine that is silent but still working is never ended by this; the server prints one note and leaves the decision to
engine_silence_s.STRATA_ENGINE_STALL_Ssets the time,0turns the check off (it needspsutil, which setup installs). Tested with mocks for the frozen, working, busy-GPU and no-reading cases; on an RTX 3060 it also ended a real engine that had stopped after its own #29 stall report.