mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #431] Cancelling a streaming request during a long prompt read only takes effect after the full prompt is read #199
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#199
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 @jkuepker on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/431
With
"stream": true, a disconnect is detected (cancel=True, 0 tokens generated), but only after the whole prompt has been read. On a 57K-token prompt, the next request waited about 17 s.Repro:
Observed:
The follow-up request took 17.2 s, even though it only needed about 0.9 s of engine time.
serve/server.pyalready checkscancelon everyPPprogress line. So either the engine doesn't act on STOP between prefill chunks, or--prefill automakes the chunks so large that the first check comes late. I haven't checked which.Expected: a cancel during the prompt read stops it at the next chunk boundary.
The release notes for 0.1.32 list "a cancelled long prompt followed by a new request" as checked. That claim holds: the new request is answered correctly with no engine restart. This issue is only about how long the new request waits.
Environment
@Niko1221 commented on GitHub (Oct 2, 2026):
Thanks for the precise repro. Fixed in 0.1.34. The engine already stops at the next prompt chunk on STOP, but the server only noticed the hang-up when a write failed. It wrote one keep-alive per prompt chunk, and the first write after a hang-up usually still succeeds, so with
--prefill auto's large chunks the cancel landed near the end of the prompt. Now a watcher per request checks the client's socket for EOF every 0.5 s and cancels, so the engine stops at the next chunk boundary. A test covers it (a request hung up after 1 s is cancelled within about a second). RunSTART-HERE.bat(Linux:./setup.sh) once to update.