apollo_starknet_client: add request and connect timeouts to the http client - #14966
Conversation
…client Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR SummaryMedium Risk Overview That lets existing Reviewed by Cursor Bugbot for commit fb04b25. Bugbot is set up for automated code reviews on this repo. Configure here. |
ron-starkware
left a comment
There was a problem hiding this comment.
@ron-starkware reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on matanl-starkware).
|
Security scan complete — no issues detected. Generated by Claude Code |
Why
RCA of the Testnet node-3 "Consensus Height Diff From Sync" spike to ~335 on Aug 12 (00:24–00:33 UTC): a single
get_block?blockNumber=latestrequest from central sync got wedged inside the GCLB front end for 612s (logged as 502internal_errorwith noserverIp, 20× the backend's 30stimeoutSec). The reqwest client is built with no timeout at all, so the call hung until central sync's no-progress watchdog fired on its 5-minute granularity — a 9m17s sync stall (~335 blocks) from one dead request.The retry layer already classifies reqwest timeout errors as retryable (
RetryErrorCode::Timeout), but reqwest never produces one without a configured timeout, so it could never engage.What
Add a 60s total request timeout and a 10s connect timeout to the shared
StarknetClientreqwest client (feeder + gateway clients). A hung connection now surfaces as a retryable timeout andrequest_with_retryre-issues the request on a fresh connection, bounding the stall at seconds instead of ~10 minutes. 60s is far above feeder p99 even for multi-MB class-definition responses.Verification
cargo build -p apollo_starknet_client— cleanSEED=0 cargo test -p apollo_starknet_client— 76 passed, 0 failedcargo clippy -p apollo_starknet_client --all-targets --all-features— cleanscripts/rust_fmt.sh— clean🤖 Generated with Claude Code