fix(disagg): unstuck decode aborts under prealloc pressure#25561
Merged
Conversation
Fix three abort-handling bugs that caused aborted decode requests to linger until WAITING_TIMEOUT (~15min) instead of being released immediately. 1. decode.py _update_handshake_waiters: skip the early-return when any receiver has been flipped to KVPoll.Failed (e.g. by an abort), so aborted reqs are not held until transfer begins. 2. scheduler.py abort_request (DECODE): in addition to calling kv_receiver.abort(), mark req.finished_reason = FINISH_ABORT for reqs in prealloc/transfer queues, so pop_preallocated / pop_transferred actually drop them. 3. tokenizer_manager.py abort_request: always forward to the scheduler when tokenizer_worker_num > 1 (the local rid_to_state is per-worker and load balancing may route abort to a non-owner). Add a guard against empty rid being treated as a startswith-prefix match for every request.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
Author
|
/tag-and-rerun-ci |
Comment on lines
+3663
to
+3664
| if not isinstance(decode_req.req.finished_reason, FINISH_ABORT): | ||
| decode_req.req.finished_reason = FINISH_ABORT() |
Collaborator
There was a problem hiding this comment.
nit: could be redundant since we have prepare_abort in PD module
Collaborator
Shunkangz
pushed a commit
to Shunkangz/sglang
that referenced
this pull request
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix three abort-handling bugs that caused aborted decode requests to linger until WAITING_TIMEOUT instead of being released immediately.
decode.py _update_handshake_waiters: skip the early-return when any receiver has been flipped to KVPoll.Failed (e.g. by an abort), so aborted reqs are not held until transfer begins.
scheduler.py abort_request (DECODE): in addition to calling kv_receiver.abort(), mark req.finished_reason = FINISH_ABORT for reqs in prealloc/transfer queues, so pop_preallocated / pop_transferred actually drop them.
tokenizer_manager.py abort_request: always forward to the scheduler when tokenizer_worker_num > 1 (the local rid_to_state is per-worker and load balancing may route abort to a non-owner). Add a guard against empty rid being treated as a startswith-prefix match for every request.
CC @ShangmingCai
CI States
Latest PR Test (Base): Run #26017657590⚠️ Not enabled — add
Latest PR Test (Extra):
run-ci-extralabel to opt in.