Skip to content

feat: add overall timeout for quote collection#25

Open
jacderida wants to merge 1 commit intoWithAutonomi:mainfrom
jacderida:feat-masque-relay-data-plane
Open

feat: add overall timeout for quote collection#25
jacderida wants to merge 1 commit intoWithAutonomi:mainfrom
jacderida:feat-masque-relay-data-plane

Conversation

@jacderida
Copy link
Copy Markdown
Contributor

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 FuturesUnordered loop in tokio::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

  • Deployed symmetric NAT testnet with 20 consecutive uploads
  • Verified quote timeout was never needed (0 fires) — uploads complete within the window
  • Verified failed uploads exit promptly instead of stalling

🤖 Generated with Claude Code

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>
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