Skip to content

[BugFix][PD]Fix metadata_buffer_index leak when aborted in PD#17483

Merged
ShangmingCai merged 4 commits intosgl-project:mainfrom
ZhengWG:fix-pd-meta-leak
Feb 9, 2026
Merged

[BugFix][PD]Fix metadata_buffer_index leak when aborted in PD#17483
ShangmingCai merged 4 commits intosgl-project:mainfrom
ZhengWG:fix-pd-meta-leak

Conversation

@ZhengWG
Copy link
Collaborator

@ZhengWG ZhengWG commented Jan 21, 2026

Motivation

In PD mode, when requests are aborted via abort_request(), the metadata_buffer_index allocated in pop_bootstrapped() is not freed, causing a memory leak. This happens when requests in the waiting_queue have already been allocated a metadata_buffer_index but are aborted before entering the inflight_queue, where the index would normally be freed.

Modifications

Added cleanup logic in abort_request() to free metadata_buffer_index when aborting requests in waiting_queue for PD mode.

Accuracy Tests

Benchmarking and Profiling

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Jan 21, 2026

@ShangmingCai Could you take a look at this PR?

Copy link
Collaborator

@ShangmingCai ShangmingCai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShangmingCai
Copy link
Collaborator

/tag-and-rerun-ci

@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Jan 27, 2026

/rerun-failed-ci

1 similar comment
@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Jan 29, 2026

/rerun-failed-ci

@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Feb 3, 2026

/rerun-failed-ci

2 similar comments
@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Feb 4, 2026

/rerun-failed-ci

@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Feb 5, 2026

/rerun-failed-ci

@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Feb 6, 2026

/rerun-failed-ci

2 similar comments
@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Feb 9, 2026

/rerun-failed-ci

@ZhengWG
Copy link
Collaborator Author

ZhengWG commented Feb 9, 2026

/rerun-failed-ci

@ShangmingCai ShangmingCai merged commit 68e31a3 into sgl-project:main Feb 9, 2026
257 of 270 checks passed
1StepForever pushed a commit to 1StepForever/sglang that referenced this pull request Feb 26, 2026
* www/pr/ks: (265 commits)
  [BugFix][PD]Fix metadata_buffer_index leak when aborted in PD (sgl-project#17483)
  Refactoring Mooncake TE as a shared distributed component (sgl-project#17810)
  [ModelOPT] Support Qwen 3 Next Coder NVFP4 (sgl-project#18224)
  Update author information in pyproject.toml (sgl-project#18453)
  [Kimi-K2.5] Fix missing `quant_config` in `KimiK25` (sgl-project#18440)
  Add tensor parallelism support to LFM2 ShortConv layers (sgl-project#17777)
  [diffusion] chore: revise process title (sgl-project#18446)
  Fix TRT-LLM MLA backend applying k_scale to BF16 KV cache in BMM1 (sgl-project#18396)
  [diffusion] refactor: group component loaders under the component_loaders/ directory (sgl-project#18438)
  [ModelOpt] Fix broken Qwen3-235B-A22B-Instruct-2507-NVFP4 launch (sgl-project#18189)
  [diffusion] feat: support efficient sequence shard (sgl-project#18161)
  [CI] fix: notebook ci may not working (sgl-project#18417)
  fix: sync server_args.kv_cache_dtype when detecting FP8 KV cache (sgl-project#18394)
  [Fix] Fix backend selection after flashinfer version update (sgl-project#18364)
  [diffusion] platform: support WAN/FLUX/Qwen-Image/Qwen-Image-edit on Ascend (sgl-project#13662)
  fix: fix NVFP4 Kimi-K2.5 weight mapping and exclude list (sgl-project#18370)
  [diffusion] feat: support saving videos directly on the server to avoid the overhead of tensor transfer (sgl-project#18253)
  [diffusion] fix: respect dist_timeout option (sgl-project#18386)
  [Doc] Fix outdated `--fp4-gemm-backend` documentation (sgl-project#18350)
  [diffusion] fix: remove unnecessary norm_type argument from GLM-Image dits (sgl-project#18382)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants