Skip to content

[Bugfix][Router] Orchestrated P/D: no ten-minute total limit on the decode request - #1127

Open
ibrahimnd2000 wants to merge 3 commits into
vllm-project:mainfrom
ibrahimnd2000:fix-pd-decode-stream-timeout
Open

ibrahimnd2000 wants to merge 3 commits into
vllm-project:mainfrom
ibrahimnd2000:fix-pd-decode-stream-timeout

Conversation

@ibrahimnd2000

Copy link
Copy Markdown
Contributor

route_orchestrated_disaggregated_request sends the decode request with aiohttp.ClientTimeout(total=600). Any response still generating after ten minutes is therefore cut mid-stream:

  • the router drops the connection;
  • the decode engine logs Aborted request;
  • the client gets a truncated body. Behind an OpenAI-compatible gateway this typically surfaces as a generic server error after the stream has started.

Long reasoning answers hit it routinely. At ~100 tokens/s per stream, anything above ~60k tokens fails, which is well within max_tokens for reasoning models.

Seen in production on a GLM-5.3 P/D deployment (vLLM 0.31) during an AIME eval sent with max_tokens: 131072:

  • three streams ended at 600.7–601.4 s after 62–66k tokens;
  • the decode engine was healthy and aborted each request at the same second the router hung up;
  • no stream lasted longer than 602 s.

Fix: no total limit on the decode request. A streaming response now fails only after DECODE_STREAM_IDLE_TIMEOUT_S (600 s) with no data, so a stalled decode is still cut but a long stream that keeps producing tokens isn't. A non-streaming response only arrives after generation, so it gets no read limit either. The prefill request keeps its 300 s limit.

Verified on our deployment: a streamed 120,000-token generation ran 834 s and completed (finish_reason=length). Before the fix it would have been cut at 600 s.

Tests: src/tests/test_disaggregated_orchestrated_decode_timeout.py runs the orchestrated flow with a fake client and checks the timeout each request is sent with:

  • streaming decode: no total, 600 s read;
  • non-streaming decode: no total, no read limit;
  • prefill: 300.

Both cases fail on main (assert 600 is None). The rest of src/tests passes (262; test_multipart_proxy.py couldn't be collected locally because httpx isn't installed). pre-commit passes.

Related orchestrated-P/D fixes: #1126 (prefill-request token limits), #1117, #1122, #1123.

…ecode request

The decode request used aiohttp.ClientTimeout(total=600), so every response
still generating after ten minutes was cut mid-stream: the client gets a
truncated body and the decode engine logs an abort. Long reasoning answers
(60k+ tokens at ~100 tokens/s) hit it. Use no total limit; a streaming
response fails after 600 s without data instead.

Signed-off-by: Muhammad Ibrahim <ibrahimnd2000@gmail.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the 10-minute total timeout limit for orchestrated decode requests to prevent long-running streaming responses from being cut off mid-stream. Instead, it introduces an idle timeout of 600 seconds that only triggers if no data is received during streaming, and adds a corresponding test suite. Feedback suggests adding explicit connection timeouts (connect and sock_connect) to the client timeout configuration to prevent requests from hanging indefinitely if the backend decode engine is unreachable.

Comment thread src/vllm_router/services/request_service/request.py
…ls fast

Signed-off-by: Muhammad Ibrahim <ibrahimnd2000@gmail.com>
@ibrahimnd2000

Copy link
Copy Markdown
Contributor Author

@ApostaC @YuhanLiu11 @Shaoting-Feng @ruizhang0101 could one of you review when you have a moment? Three small fixes to the orchestrated P/D path, each with tests:

The k8s-discovery-e2e-test failure here is the CI cluster's vLLM pods not becoming ready within 600 s; it also fails on unrelated PRs this week. All three fixes have been running in our production deployment since 9 Oct.

Signed-off-by: Muhammad Ibrahim <ibrahimnd2000@gmail.com>
@ibrahimnd2000
ibrahimnd2000 force-pushed the fix-pd-decode-stream-timeout branch from 4e63f3c to 68c61f6 Compare October 22, 2026 18:00

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant