Repository navigation
[PD] Simplify late-abort quiescent ack branch to else - #40711
Merged
Merged
Conversation
With the guarding condition now taking every case with writes outstanding (room active or outstanding > 0), the elif's == 0 re-check can only differ on a negative counter, where it would silently drop the abort (no ack, no registration) and leave decode to wait out the release timeout. A negative count still means nothing is in flight, so ack unconditionally. Follow-up to #40645. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ShangmingCai
requested review from
ByronHsu,
Duyi-Wang,
HaiShaw,
hnyls2002 and
sogalin
as code owners
September 22, 2026 07:15
livingshade
added a commit
to livingshade/sglang
that referenced
this pull request
Sep 23, 2026
Pick up sgl-project#40645, sgl-project#40711, the shared prefill->decode status plumbing (sgl-project#36612) and runtime role switching (sgl-project#28403). Conflict resolution: - common: keep upstream's update_status structure and still reset the deferred-ACK state when a room lifecycle starts. CommonKVSender.clear() follows sgl-project#40645: ACK now when nothing is in flight, else keep the target. - mooncake: the PR's unconditional register-then-try-ACK already covers sgl-project#40645 and sgl-project#40711. - nixl: keep upstream's settle-then-conclude exception path and still poison the ACK target, since that chunk stays counted. - mori: re-apply the drain-aware ACK path on upstream's conclude_transfer / conclude_failure API and list-returning _submit_kv_transfer; register the drain threads with teardown() and stop them with a sentinel. - tests: update stubs for the new NIXL exception path and for the deferred-ACK fields CommonKVManager now always owns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Motivation
Follow-up to #40645 (stacked on its branch — merge after it lands; this PR then reduces to one commit). Raised in this review comment.
With #40645's guarding condition (
room_active or outstanding > 0), theelif self._staging_outstanding.get(room, 0) == 0branch in the Mooncake bootstrap ABORT handler is only reached when the room is inactive andoutstanding <= 0, so the== 0re-check can never usefully be false. The one state where it differs is a hypothetically negative counter, where theelifsilently drops the abort (no ack, no registration), leaving decode to wait out the release timeout — while a negative count still means nothing is in flight, so acking is correct.Modifications
Replace the redundant
elifwith a plainelseand update the comment. No behavior change in any reachable state; strictly more robust if the counter ever went negative.Validation
Cosmetic/robustness-only; covered by the existing PD wire and deferred-release unit tests exercised on #40645.
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #35717855305
Latest PR Test (Extra): ❌ Run #35717855081
Latest PR Test (AMD ROCm 10): ❌ Run #35717855304