Skip to content

fix(e2e): clean up NPU async FFN process trees - #279

Draft
ShwStone wants to merge 1 commit into
vllm-project:mainfrom
ShwStone:fix/npu-async-e2e-cleanup
Draft

fix(e2e): clean up NPU async FFN process trees#279
ShwStone wants to merge 1 commit into
vllm-project:mainfrom
ShwStone:fix/npu-async-e2e-cleanup

Conversation

@ShwStone

@ShwStone ShwStone commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • tag NPU async E2E process trees by run and role
  • kill every matching FFN process through procfs during teardown
  • keep one bounded 120-second cleanup window
  • retain focused procfs, process-identity, and role-isolation coverage

Testing

  • 149 related unit tests
  • pre-commit
  • real procfs cleanup smoke test

Fixes #251

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The run/role tagging and bounded procfs cleanup are well scoped, and the related 148 unit tests pass locally. I found one process-identity race that should be addressed before merge.

Comment thread tests/e2e/process_utils.py Outdated
):
for pid in matching_pids:
try:
os.kill(pid, signal.SIGKILL)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Please avoid signaling a recycled PID. find_processes_matching_environment() closes the procfs files and returns bare numeric PIDs; while this loop is running, a matched worker can exit and its PID can be reused before os.kill(). In that case teardown can SIGKILL an unrelated process that never carried these markers—the preceding group SIGKILL makes this race especially relevant. Please keep a stable process identity across matching and signaling (for example, open a pidfd before reading /proc/<pid>/environ and signal that pidfd, or verify the process start time immediately before signaling), and add a test covering the exit/reuse window.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 45c4ccf: the scanner opens a pidfd before reading environ and SIGKILL is sent through that stable handle. Added a regression test for exit and immediate numeric-PID reuse.

NPU async FFN workers can outlive or leave their launcher process group while a pending CAM receive blocks teardown. Tag each managed process tree with a unique run id and role, then find and SIGKILL all matching FFN processes through procfs after normal group cleanup.

Delegate only the FFN group liveness check to one bounded 120-second procfs cleanup phase, and extend the outer cancellation window to cover nested cleanup. Keep focused coverage for exact environment matching and role isolation.

Fixes vllm-project#251

Signed-off-by: ShwStone <HaowenShi@outlook.com>
@ShwStone
ShwStone force-pushed the fix/npu-async-e2e-cleanup branch from fd3bac6 to 45c4ccf Compare August 27, 2026 08:10
@jiangkuaixue123 jiangkuaixue123 added the ready Used to trigger ready CI in PRs. label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Used to trigger ready CI in PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPU async E2E teardown always fails pytest

2 participants