[Security] Roll back request registration if engine add fails - #56212
Open
jperezdealgaba wants to merge 1 commit into
Open
jperezdealgaba wants to merge 1 commit into
jperezdealgaba wants to merge 1 commit into
Conversation
Co-authored-by: Cursor Agent Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com>
jperezdealgaba
requested review from
AndreasKaratzas,
DarkLight1337,
NickLucche,
aarnphm,
chaunceyjiang,
mgoin,
njhill,
robertgshaw2-redhat and
russellb
as code owners
September 10, 2026 07:15
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
justtestingthingsx
pushed a commit
to meandmyboiclaude/vllm
that referenced
this pull request
Sep 19, 2026
…esolution Both PRs' cleanly-applied hunks wrapped add_request's body in a new try:, whose insertion point sat OUTSIDE the conflict region. Resolving the conflict to our side then re-emitted our (upstream a715606) version below it, so the function carried both copies and the try: had no except -- a SyntaxError, in a file the commit-time py_compile gate never opened, because an unmerged path is not listed by git diff --cached --diff-filter=ACM. Upstream a715606 already provides the restructure both PRs wanted, so the duplicate block is dropped and our version stands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch has not been deployed
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
AsyncLLMandLLMEngineregister a request in the output processor before sending it to EngineCore. If that send fails (for example MessagePack cannot encode an oversized integer), the localRequestStatewas left behind with no abort path. This change rolls back registration when engine add fails, and rejects oversizedstream_interval/top_kvalues at the API andSamplingParamslayers.Changes
vllm/v1/engine/async_llm.py: abort the registered request ifadd_request_asyncfails; abort already-sent siblings whenn>1fan-out fails.vllm/v1/engine/llm_engine.py: same rollback for the sync add path.vllm/sampling_params.py: rejecttop_kandstream_intervalabove the MessagePack integer range.top_kandstream_intervallike neighboring int64 fields.Codepath coverage
/v1/chat/completions,/v1/completions,/v1/messages,/v1/responses,/invocations) viaAsyncLLM._add_request._add_request.n>1) sibling rollback onAsyncLLM.add_requestandLLMEngine.add_request.LLMEngine.add_request.SamplingParamsvalidation for the reported oversized integer triggers.Duplicate-work check
Searched open and merged PRs for
async_llm _add_request,stream_interval,RequestState leak,top_k int64, and rollback/abort of failed engine add. Related but incomplete: #51629 (ParentRequest leftover onn>1abort; does not wrap register-then-send), #50101 / #55226 (stream_intervalsemantics, not bounds or leak), #49754 (exposed per-requeststream_interval). No open or merged PR closes this register-then-send window.Tests
test_async_add_request_rolls_back_on_encode_overflow/test_sync_add_request_rolls_back_on_engine_send_failure: real MessagePack overflow after register leaves noRequestState.test_async_parallel_add_rolls_back_siblings_on_later_send_failure/ sync counterpart: later child send failure aborts already-sent siblings.test_async_add_request_keeps_state_when_engine_accepts: happy path still registers.stream_interval/top_k;SamplingParamsrejects values above the MessagePack range.Commands:
.venv/bin/python -m pytest tests/v1/engine/test_add_request_rollback.py tests/entrypoints/unit_tests/test_sampling_int_bounds.py tests/test_sampling_params.py -v(38 passed).pre-commit run --fileson the changed files (passed).AI assistance
This PR was developed with AI assistance.
Made with Cursor