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#2502
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/Niko1221/Strata/pull/194
Author: @demon851113
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:fix-183-stale-err📝 Commits (1)
b1482f6serve: clear the error string at the start of every request (#183)📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
src/program/generate.cpp(+2 -0)📄 Description
Fixes #183.
Root cause
errinmain()is one string shared by every--serverequest, and nothing clears it between requests. When a request is cancelled while it reads the prompt,Prefill::runsetserr = "cancelled". The serve loop treats that as a cancel rather than a failure, becausestop_reqis set, and finishes withDONE ... cancel, but it leaveserrholding"cancelled".The next request clears
stop_reqbut noterr. When it reads its prompt through the batched path,sp.on_chunkstarts withso the stale
"cancelled"string counts as a failure.sp.runreturns false andstop_reqis now false, so the loop printsstrata serve: cancelled/ERR cancelledandreturn 1s. The server then reloads the whole model.That matches the log in #183: the cancelled request ends cleanly, and the next request fails with the misleading
cancellederror, a few seconds in. A short next request goes through the window path, which does not checkerrup front, so it survives. That is why the crash only shows up when the next prompt is long.Fix
Clear
errat the start of every request, next to the existingstop_req.store(false). This is two lines, one of them a comment.Validation
RTX 5070 Ti 16 GB (sm_120), Ubuntu 24.04, CUDA 13.2, IQ3_XXS native pack,
--kv int8 --kv-resident 32768(streamed KV, the same KV setup as the report),--spec 4+ MTP. The engines were private (serve.server.StrataEngine, the class the HTTP server uses), with--adapt-swaps 0, greedy, and a 34,719-token prompt. The sequence was R1 = the prompt, cancelled 3 s in (acancelevent, which makes the wrapper sendSTOPexactly as on a client disconnect); R2 = the same prompt, 64 tokens; R3 = a short prompt.a790805(0.1.27)ERR cancelled, engine exits 1a790805+ this fixa790805+ this fix, no R1 (fresh read)--conversation-cache-mib 8192The unfixed engine also crashes through the HTTP server: a streaming
/v1/chat/completionsrequest disconnected 5 s into a 34,759-token prompt, and the next request gotthe engine stopped unexpectedly (exit code 1).The fix also means a checkpoint taken while the cancelled request was reading (here at 16,384) keeps working for the retry, as #183 asks under "Ideally". The resumed answer matches a fresh read token for token.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.