Repository navigation
fix(llm-client): fall back when an upstream connect times out - #854
ayushag-nv merged 3 commits into
Conversation
Signed-off-by: Ting-Hong Shieh <shiehharry@gmail.com>
Signed-off-by: Ting-Hong Shieh <shiehharry@gmail.com>
Signed-off-by: Ting-Hong Shieh <32212900+ting-hong-shieh@users.noreply.github.com>
|
Updated with main Local validation passed: Rust workspace (1,109 passed, 1 ignored), prefill runner (82 passed), Python (198 passed, 2 integration tests deselected), Clippy, formatting, Ruff, mypy, and strict docs build. The connect-timeout regression is Linux-only, so the new Linux CI result is still needed. The latest CI, documentation, getting-started, and package-portability runs show |
ayushag-nv
left a comment
There was a problem hiding this comment.
Thanks @ting-hong-shieh for this one. Neat fix.
What
Classify an upstream connect timeout as
Transport, so completion routing can try the next candidate after retries are exhausted.Why
Closes #853. Reqwest reports connect timeouts as both
is_connect()andis_timeout(). Checking timeout first producesTimeout, which stops candidate fallback. Checking connect first treats the failed connection like other connection failures.Notes for reviewers
Start with
convert_reqwest_errorincrates/libsy-llm-client/src/client.rs.timeout_ms, including expiry during a connect, remainTimeoutand stop completion candidate fallback.upstream_errorinstead of 504upstream_timeout.fail_openpolicy; this PR adds no judge recovery policy. As with other transport failures, a redirected request may already have reached an earlier endpoint before a later connection fails.The Linux connect-timeout regression fills a listener's accept queue and uses a 100 ms connect timeout. It checks that the source is a reqwest error with both connect and timeout flags, classified as
Transport. Reverting the classification to timeout-first makes it fail withTimeout. The refused-connection routing test checks the existing fallback path and passes on main as well.The branch includes main
9ddd4879, and the fallback fixture explicitly disables failure cooldown.Validation
At
8aaaa0fb, integrated with main9ddd4879:Local validation ran on macOS. The accept-queue connect-timeout regression is Linux-only and must be confirmed by the new Linux CI run. Mock HTTP tests made no live provider calls.
Summary by CodeRabbit