mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1994] Batch slots return HTTP 400 "BGEN: no such free slot" instead of queueing; the affected conversation stays broken #794
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#794
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 @jsilve12 on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1994
Title: Batch slots return HTTP 400 "BGEN: no such free slot" instead of queueing; the affected conversation stays broken
Body:
Summary
With
--batch 4(and--batch-groups auto) on a layer split, a request thatarrives when all slots are busy is rejected with HTTP 400 rather than waiting:
docs/BATCHING.md says the opposite for this case:
So the documented behaviour is to queue. What we observe is a hard 400.
Why this matters
A 400 is not retryable from the client's point of view, and in our run the
affected conversation did not recover: every subsequent turn from that stream
returned the same error immediately (0 tokens, ~0.1 s). One rejection
permanently killed that stream for the rest of the session.
Reproduction
4 concurrent HTTP clients, each holding a growing conversation (5 turns each),
against the lane while normal traffic is also in flight:
got: EMPTY,finish: ERROR:{'type': 'invalid_request_error', 'message': 'BGEN: no such "Each turn appends to the conversation, so prompts grow ~12k tokens per turn
(13.7k -> 25.8k -> 37.8k -> 49.9k -> 62.0k).
The conversation cache was working for the other streams
(
reusedclimbing 13,663 -> 25,770 -> 37,834 -> 49,883), so this is not acache miss - it looks like slot exhaustion.
Environment
--trim-stage-weights--batch 4 --batch-groups auto --expert-cache 30000 --prefill auto:32768--spec 4 --mtp ... --max-context 262144 --kv fp16 --kv-resident 4194304--conversation-cache-mib 16384 --conversation-cache-slots 8/v1/statusreportedconcurrency: {"serving": 4, "requested": 4}/metricsat the time showedlive.slotsall idle andwaiting: 1,outside_slots: 2What I think should happen
A request that cannot get a slot should wait (as documented), or at minimum
return a retryable status (503 + Retry-After) rather than 400 - and a
conversation that was rejected should be able to retry successfully on its next
turn rather than being permanently broken.
Possibly related
--batch-groupsdisables the per-slot conversation cache)Happy to run any instrumentation you want -
/metricsis very informative and Ican capture slot occupancy over time if that helps.
@Niko1221 commented on GitHub (Oct 12, 2026):
Thank you for the detailed report and the metrics. You are right on both counts: the docs promise that a request waits for a free slot, and a rejected conversation must not stay dead.
What was wrong: the engine refused a BGEN for a slot it still considered occupied while the server believed it free (its own bookkeeping and the engine's view of the slot differed for a moment). The server turned the engine's "ERR BGEN: no such free slot" into an HTTP 400, and because a conversation is drawn back to the slot that holds its prefix, the next turns went to the same slot and got the same refusal. That matches your /metrics (slots idle, waiting 1).
What the fix does: an engine refusal of a slot is no longer a client error. The refused slot is parked for a couple of seconds, the request takes another slot or waits for one, and the conversation's next turn is not affected. If the engine keeps refusing (6 tries) the answer is a 503 with Retry-After instead of a 400, and no slot stays marked busy. It is covered by tests with the fake engine (one refusal retried and answered; permanent refusal gives 503 and frees the slots). It is in 0.1.43.1 (out now).
I could not reproduce the exact engine-side moment where the two views differ, so if it still shows up after the hotfix, the new log line "parallel: the engine refused slot N ... (issue #1994)" plus /metrics at that time would pin it down.
Meanwhile: a client that retries a 400 whose message starts with "BGEN:" after a second or two reaches a free slot; sending the conversation to a fresh slot (changing the first user message slightly) also breaks the pull to the stuck slot.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for the report. This is fixed in 0.2.0-beta (or an earlier release), and we're closing it as part of the tracker reset for 0.2.0-beta.
If it still happens on 0.2.0-beta, add the area prefix to the title ([Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]), put the Strata version and your hardware in the issue form fields, and comment
/reopen. A check runs and reopens it.