[fix] Fix deadlock and TOCTOU race in pause-aware weight update locking - #22754
Merged
yueming-yuan merged 1 commit intoApr 14, 2026
Merged
Conversation
Fix writer lock deadlock in update_weights_from_ipc and post_process_weights during pause_generation, and close a TOCTOU race in all four weight update paths (update_weights_from_distributed, update_weights_from_tensor, update_weights_from_ipc, post_process_weights). When paused, hold is_pause_cond during the weight update so resume_generation cannot race between the check and the update. When not paused, acquire the writer lock as before. Combines sgl-project#22211 (deadlock fix) and sgl-project#22304 (TOCTOU fix). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maocheng23
requested review from
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
April 14, 2026 04:38
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
yueming-yuan
pushed a commit
that referenced
this pull request
May 21, 2026
JessicaJiang-123
pushed a commit
to JessicaJiang-123/sglang
that referenced
this pull request
Jun 21, 2026
nanjiangwill
pushed a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
XinyuJiangCMU
pushed a commit
to XinyuJiangCMU/sglang
that referenced
this pull request
Jul 17, 2026
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 2026
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 2026
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 2026
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 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.
Summary
update_weights_from_ipcandpost_process_weightsduringpause_generationmodeupdate_weights_from_distributed,update_weights_from_tensor,update_weights_from_ipc,post_process_weightsis_pause_condduring the weight update soresume_generationcannot race between the check and the update. When not paused, acquire the writer lock as before.nullcontextimportsglang-miles-v0.5.10Test plan
🤖 Generated with Claude Code