Repository navigation
Conversation
|
Hi @autrk, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
ngxson
approved these changes
May 23, 2026
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.
Overview
When running llama-server in router mode with --timeout 0, every proxied request fails with:
proxy error: Failed to read connectionRoot Cause
The router proxy reuses timeout_read/timeout_write for its internal HTTP client (httplib::ClientImpl), which uses poll() - where {0, 0} means "return immediately", not "no timeout". This differs from the non-router server, which uses setsockopt(SO_RCVTIMEO) where {0, 0} correctly disables the timeout (blocking mode).
Fix
Skip setting httplib timeouts when the value is 0, falling back to httplib's built-in defaults (connection_timeout: 300s, write_timeout: 5s, read_timeout: 300s). Note that --timeout 0 in router mode therefore does not mean "no timeout" - users who need longer timeouts should set an explicit value like --timeout 86400.
Additional information
Commit ff6b106 (PR #22003) replaced the hardcoded 5-second connection timeout in server_http_proxy with the user-configurable timeout_read value:
cli->set_connection_timeout(timeout_read, 0); // was: (5, 0)The same issue affects set_write_timeout(timeout_read, 0) and set_read_timeout(timeout_write, 0).
Requirements