From e1955bf57ab39a4de7f7daf9a619e4f68f952ed9 Mon Sep 17 00:00:00 2001 From: XiaoTian <47113549+gogongxt@users.noreply.github.com> Date: Fri, 5 Jun 2026 19:46:35 +0800 Subject: [PATCH] fix(pd): clear stale bootstrap_room when freeing metadata buffer slot (#27374) Co-authored-by: gongxiaotian --- python/sglang/srt/disaggregation/decode.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/sglang/srt/disaggregation/decode.py b/python/sglang/srt/disaggregation/decode.py index 41f92d51c..b5ede8691 100644 --- a/python/sglang/srt/disaggregation/decode.py +++ b/python/sglang/srt/disaggregation/decode.py @@ -1676,6 +1676,9 @@ class DecodeTransferQueue(DecodeHiCacheTransferMixin): ) idx = self.queue[i].metadata_buffer_index assert idx != -1 + # Reset so the next owner sees actual_room == 0 ("not yet written") + # instead of the stale value, avoiding a false-positive mismatch. + self.metadata_buffers.bootstrap_room[idx] = 0 self.req_to_metadata_buffer_idx_allocator.free(idx) self.queue = [