Skip to content

[PD] Simplify late-abort quiescent ack branch to else - #40711

Merged
ShangmingCai merged 3 commits into
mainfrom
shangming/pd-abort-ack-else-cleanup
Sep 22, 2026
Merged

ShangmingCai merged 3 commits into
mainfrom
shangming/pd-abort-ack-else-cleanup

Conversation

@ShangmingCai

@ShangmingCai ShangmingCai commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

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), the elif self._staging_outstanding.get(room, 0) == 0 branch in the Mooncake bootstrap ABORT handler is only reached when the room is inactive and outstanding <= 0, so the == 0 re-check can never usefully be false. The one state where it differs is a hypothetically negative counter, where the elif silently 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 elif with a plain else and 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

cctry and others added 2 commits September 21, 2026 16:19
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
ShangmingCai merged commit 861b11f into main Sep 22, 2026
95 of 111 checks passed
@ShangmingCai
ShangmingCai deleted the shangming/pd-abort-ack-else-cleanup branch September 22, 2026 11:08
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants