Repository navigation
Conversation
When failover ends before response headers and the last error is an
aiohttp.ClientError (for example, connection refused or DNS failure),
route_general_request re-raises it. Uvicorn then logs "Exception in ASGI
application" with a traceback, and the client receives a plain-text 500
Internal Server Error.
Return the 503 status and JSON body that proxy_multipart_request already
uses for this failure, {"error": "Failed to connect to backend: ..."},
and include the X-Request-Id header. Other exceptions are re-raised
unchanged, and mid-stream failures are unaffected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mazyad Alabduljaleel <mazjaleel@gmail.com>
Mazyod
requested review from
ApostaC,
Shaoting-Feng,
YuhanLiu11 and
ruizhang0101
as code owners
October 20, 2026 09:34
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the route_general_request function in src/vllm_router/services/request_service/request.py to handle aiohttp.ClientError when backends are unreachable, returning a 503 JSONResponse with the request ID and a descriptive error message. Additionally, a new unit test test_unreachable_backends_return_503_after_all_attempts has been added to src/tests/test_instance_failover.py to verify this error handling behavior. There are no review comments to address, and I have no further feedback to provide.
Mazyod
pushed a commit
to Mazyod/production-stack
that referenced
this pull request
Oct 20, 2026
…laybook Point the single-label hostname patch at upstream PR vllm-project#1154, which superseded the now-closed vllm-project#737. Record that the DNS resolver change is proposed upstream for the shared client only (vllm-project#1161/vllm-project#1162), and that upstream vllm-project#1164's 503 must not replace the fork's documented 502 envelope on a refresh. Add the evidence-based playbook for getting fixes merged upstream. Docs only; does not trigger an image release. Standard pre-commit hooks pass on the changed files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A5cnah4yC2sS7LEZ8mdrTd Signed-off-by: ci-sim <ci@sim>
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.
FIX #1163
Today, when failover ends before response headers and the last error is an
aiohttp.ClientError(connection refused, DNS failure, and similar),route_general_requestre-raises it. Clients get a plain-text 500, and uvicorn logsException in ASGI applicationwith a traceback.This PR returns the same 503 status and JSON body as
proxy_multipart_request,{"error": "Failed to connect to backend: ..."}, and addsX-Request-Idto the response. Other exceptions are re-raised as before, mid-stream failures are unchanged, and the existing failover tests are untouched.Testing:
test_unreachable_backends_return_503_after_all_attemptsinsrc/tests/test_instance_failover.py. It fails on main and passes with this change.503 application/jsonwithX-Request-Idand logged no ASGI traceback. Main returns500 text/plainand logs a traceback.ruff checkpass.-swhen doinggit commit[Bugfix],[Feat], and[CI].