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 <[email protected]>
Signed-off-by: Mazyad Alabduljaleel <[email protected]>
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.
…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 <[email protected]> Claude-Session: https://claude.ai/code/session_01A5cnah4yC2sS7LEZ8mdrTd Signed-off-by: ci-sim <ci@sim>
…m-project#939 - Add related work (vllm-project#939, vllm-project#984, vllm-project#1164, vllm-project#1115, vllm-project#876) - Drop --retry-on-backend-5xx and request_retries_total; reuse vllm-project#939 - Re-scope Phase 1a to stall detection and passive ejection - Require new settings in the dynamic config - Replace line-number reference with function names Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Punit Vara <[email protected]>
|
Hi @ruizhang0101, when you have a chance, does returning 503 here make sense to you? I picked it to match the multipart path. Happy to adjust if you’d prefer a different response. Thanks! |
|
Status update: this still merges cleanly onto current main ( |
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].