mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #603] serve: drain a stopped request to its DONE with one conversation (later requests got the previous answer) #622
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#622
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?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/603
Author: @merbanan
Created: 10/28/2026
Status: 🔄 Open
Base:
main← Head:pr/serve-drain📝 Commits (1)
e7e87e9serve: a stopped request is drained to its DONE with one conversation - the drain went on after STRATA_DRAIN_S while the engine was still reading the prompt chunk (STOP is looked at between chunks, over a minute deep in a long context), and every later request read the one before's answer📊 Changes
2 files changed (+86 additions, -7 deletions)
View changed files
📝
serve/server.py(+23 -7)📝
serve/test_multi.py(+63 -0)📄 Description
What
With one conversation (no
--parallel), a request that's stopped is drained until itsDONE. Before this change, the drain gave up afterMAYA_DRAIN_S(60 s). If the engine was still working on the stopped request at that point, itsT … DONElines stayed in the shared line queue. The next request then read them as its own, and every request after that got the previous request's answer.Seen on the live service. A client went away 70 s into reading a long prompt.
STOPonly between the prompt's chunks, and one 32K chunk deep in a 140K context takes more than a minute. So the drain loggedstopped, and the engine did not say the request had ended within 60 s - going on.DONE, and the request after that got its predecessor's answer. In the log this shows asdone: 52 tokens in 0 s (95200 tok/s)anddone: 0 tokens … (length).The change
DONE(orERR, or the engine's end). The engine is busy with that request either way, so going on early gains nothing.MAYA_ENGINE_STALL_S: no CPU, disk or GPU work for that long), which ends the engine. The next request then starts it again.MAYA_DRAIN_Sis now when the drain logs that it's still waiting. When the request finally ends, the drain logs how long it took.DONEis dropped there, not handed to another request.ERRand of the engine's end (_done_after_err,Noneput back).Tests
serve/test_multi.py::AStoppedLongPromptuses a fake single-stream engine that looks atSTOPonly after a 1.5 s "chunk", withDRAIN_Sat 0.3 s. A request is stopped mid-prompt, and the next request must get its own tokens.[]: the stopped request'sDONEends it.serve/test_multi.py,test_server.py,test_fair.pyandtest_stop.py: 149 passed, 1 skipped.The fix has been running on the live V100 GLM service since then.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.