Fix rejected request handling for embeddings#1
Merged
samstokes merged 2 commits intorelease-v0.11.2+evefrom Dec 12, 2025
Merged
Fix rejected request handling for embeddings#1samstokes merged 2 commits intorelease-v0.11.2+evefrom
samstokes merged 2 commits intorelease-v0.11.2+evefrom
Conversation
- Add finish_reason field to PoolingOutput and PoolingRequestOutput classes - Update output processor to pass finish_reason through pipeline - Add _handle_pooling_error_finish_reason helper to serving engine - Update all pooling endpoints to check finish_reason and return 503 for rejections - Fixes crash when pooling/embedding requests are rejected due to full queue - Ensures rejected pooling requests return proper 503 errors instead of 200 with empty data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
kevinzwang
approved these changes
Dec 11, 2025
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.
Purpose
PR vllm-project#27064 that adds
max-waiting-queue-lengthdoes not work for pooling/embedding requests. If one of those requests is rejected due to a full waiting queue, they trigger an assertion failure in the output processor that crashes the output handler and marks the engine as dead, causing subsequent/healthrequests to return 503. In k8s this leads to the pod being replaced, but that's an expensive way to recover from a temporary overload.This extends the handling of rejected requests added in the above PR to also handle rejected pooling requests, so it will return 503s only from the rejected requests instead of poisoning the server.
In order to do that correctly, this extends
PoolingOutputto contain afinish_reason.Test Plan
Tested manually using local test scripts.
Test Result
Sending a flood of embedding requests with
--max-waiting-queue-lengthreturns 200 until the queue hits max, then returns 503 until the queue drains again (e.g. with appropriate backoff from the client), then returns 200 again.