feat: add overall timeout for quote collection#25
Open
jacderida wants to merge 1 commit intoWithAutonomi:mainfrom
Open
feat: add overall timeout for quote collection#25jacderida wants to merge 1 commit intoWithAutonomi:mainfrom
jacderida wants to merge 1 commit intoWithAutonomi:mainfrom
Conversation
Individual quote requests have per-peer timeouts, but the connection establishment (connect_with_fallback) can take up to 80s per peer and isn't covered by the per-peer timeout. Without an overall timeout, a single unreachable peer causes the entire upload to stall indefinitely. Wraps the quote collection loop in a 120s tokio::time::timeout. If the timeout fires, the upload fails fast with a clear error message showing how many quotes were collected and which peers failed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Add a 120-second overall timeout for quote collection to prevent uploads from stalling indefinitely when a peer is unreachable.
Problem
Individual quote requests have per-peer timeouts (10s), but the connection establishment (
connect_with_fallback) can take up to 80s per peer and isn't covered by the per-peer timeout. Without an overall timeout, a single unreachable peer causes the entire upload to stall indefinitely — we observed a 1-hour stall in testing.Change
Wraps the quote collection
FuturesUnorderedloop intokio::time::timeout(120s). If the timeout fires, the upload fails fast with a clear error message showing how many quotes were collected and which peers failed, allowing the client to move on to the next upload attempt.Test plan
🤖 Generated with Claude Code