You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 24afe5e
Browse filesBrowse the repository at this point in the historyBrowse files
fix: the CUDA server stops a request when its client has gone or its per-token work fails
The CUDA server stopped a request only when a streamed write failed with a broken pipe or a reset. A
non-streamed request always ran to its reply limit, a stream stopped only at a round that wrote text (not
inside a hidden tool call), and a request queued behind the server lock was prefilled and decoded after its
client had left. A write that timed out, or any other failure in the per-token callback, raised into the
engine's decode loop; with two ranks that skips the stop that keeps rank 1 in step.
- App.run takes cancelled=; the handler passes the Mac server's socket check (socket_cancellation) for
streamed and non-streamed requests. The callback checks it every round, with or without new text, and
asks the engine to stop.
- A request whose client left while it waited for the lock raises RequestCancelled before generate: no
prefill, no engine call, nothing written.
- A request stopped for its client raises RequestCancelled once generate returns, as on the Mac server: no
final chunk, no [DONE], no JSON reply. A client that has only shut its sending side does not get the
stopped prefix as a whole reply with finish_reason "length".
- The callback never raises into the engine. A failure is kept, the engine is asked to stop, and the
failure is raised after generate returns. After a stop or a failure the callback returns True at once, for
the engines that finish on both ranks and keep calling.
- A streamed write treats any OSError (timed out, host unreachable) as a client that has gone; the JSON
reply ignores a broken pipe or a reset.
Engines stop through the path a failed streamed write already takes. No engine or arithmetic change;
tokens sent before a stop are unchanged. Not covered: a request waiting inside the concurrent scheduler
before admission is prefilled, then stops after its first round.
Test: tests/test_cuda_server_disconnect.py (17 cases; 14 fail without the fix).
(cherry picked from commit c55cb7d)
0 commit comments