Skip to content

[sgl-router] Abort unfinished engine requests on cancellation - #40605

Open
sherlockwu wants to merge 1 commit into
mainfrom
codex/router-engine-abort
Open

sherlockwu wants to merge 1 commit into
mainfrom
codex/router-engine-abort

Conversation

@sherlockwu

@sherlockwu sherlockwu commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Cancelled chat requests can leave the engine generating after the router releases its resources.

Modifications

Add a small abort guard for plain-mode dispatch and streaming. Preserve a caller's string rid, otherwise inject a fresh UUID (gateway request IDs are reused across retries and the engine keys in-flight state by rid), and send a bounded, best-effort /abort_request when forwarding ends unfinished. Completed responses and rejected streams disarm the guard; PD prefill keeps its existing lifetime.

Stacked on #40604.

Accuracy Tests

Workspace library and integration tests passed after updating payload assertions for the injected ID. Added one compact regression covering unary/streaming cancellation, successful completion, ID preservation, and abort authorization. cargo check --locked --workspace --all-targets, strict Clippy, and formatting passed.

Speed Tests and Profiling

Not run; no inference changes.


CI States

Latest PR Test (Base): ✅ Run #35682350902
Latest PR Test (Extra): ❌ Run #35682350661
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.

@github-actions github-actions Bot added the npu label Sep 21, 2026
@sherlockwu
sherlockwu force-pushed the codex/router-engine-abort branch from 00aa895 to c6db472 Compare September 21, 2026 17:35
@sherlockwu
sherlockwu added this pull request to stack #40625 September 21, 2026 20:36
@sherlockwu sherlockwu added router run-ci CI: run the baseline test suite on this PR and removed npu labels Sep 21, 2026
@sherlockwu
sherlockwu force-pushed the codex/router-engine-abort branch from c6db472 to 509899c Compare September 21, 2026 22:39
@github-actions github-actions Bot added the npu label Sep 21, 2026
@sherlockwu
sherlockwu force-pushed the codex/router-engine-abort branch from 509899c to d8953a9 Compare September 22, 2026 02:04
Base automatically changed from codex/router-readiness-startup to main September 22, 2026 03:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npu router run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant