mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1059] serve: a request the engine rejects with ERR waits the full 300 s before failing (STOP + _drain_control("DONE") after an ERR), holding the control lock #455
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#455
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 @cardosofelipe on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1059
Summary: when the engine rejects a request with an
ERR …line, the server waits the full 300 s before failing it, and appears to hold the engine's control lock while it waits. A request the engine refuses immediately takes 5 minutes to fail.Version: v0.1.39 (
6f32ec07), observed on Linux, RTX 3090. The same code path is unchanged in v0.1.40 (serve/server.py,_drain_controlline 937 and thefinallyblock around line 1225;generate.cppline 8081).What happens
ERR …andcontinues back to its input loop. It never printsDONEfor that request.ValueErrorfrom theERRline ([strata] the engine reported an error: …), as expected.finallyblock then runs, withphase == "solo": it sendsSTOPand calls_drain_control("DONE").DONE(or furtherERR) line arrives._drain_controlwaits out its hard-codedtimeout=300.0.done: 0 tokens in 300 s (0.0 tok/s) (error, cancel=False). The client sees nothing until then; a client with a shorter idle timeout gives up first.Reproduction (any up-front engine rejection works; this is how we hit it)
"vision"section but without--visionin the engine args (our mistake; setup adds both).image_urlpart.[strata] the engine reported an error: this engine was started without --vision, thendone: 0 tokens in 300 s (0.0 tok/s) (error, cancel=False). Six image requests in a row took 6 × 300 s; GPU idle at 0 % throughout.Other
ERRs on the same pre-generation path should behave the same (from reading the code, not tested):ERR bad request,ERR prompt (…) + max_new (…) exceeds the context,ERR a token id is outside the vocabulary,ERR the K/V cannot grow to this prompt: no VRAM is left. The last one seems the most likely to occur in normal use with"parallel"and long contexts.Impact beyond the one request (from reading the code, not measured): the drain runs before
self.ctl.release(), so other requests appear to be blocked for the same 300 s.Possible fix: when the request ended because of an engine
ERRline, the engine has already finished with it, so skip theSTOP+_drain_control(or bound that drain to a few seconds). The engine already discards a staleSTOPbetween requests (stop_req.store(false)before a new request), so not sending one is safe.Happy to test a patch on this setup.
@Niko1221 commented on GitHub (Oct 7, 2026):
Fixed in 0.1.40.2: when the engine answers a request with an ERR line and goes idle, the server now ends the exchange there instead of sending STOP and waiting up to 300 s for a DONE that never comes. Thank you for the repro and the place in the code.