Skip to content

fix: add client timeouts to prevent hung upstream connections#26

Merged
cptrodgers merged 1 commit intomainfrom
hn/set-timeout-for-connection
Mar 30, 2026
Merged

fix: add client timeouts to prevent hung upstream connections#26
cptrodgers merged 1 commit intomainfrom
hn/set-timeout-for-connection

Conversation

@cptrodgers
Copy link
Copy Markdown
Owner

Summary

  • Configure reqwest::Client with connect_timeout (5s), pool settings, and per-request timeouts (30s) on non-streaming paths — SSE connections are excluded to avoid killing long-lived streams
  • Add connect_timeout and request_timeout as configurable options in mcpr.toml
  • Apply timeouts to all previously unprotected clients: tunnel, onboarding, and widget asset fetches

Fixes the inconsistency where only the health check client had timeouts while the main proxy client could block forever on a hung upstream.

@cptrodgers cptrodgers merged commit 07827c0 into main Mar 30, 2026
1 check passed
@cptrodgers cptrodgers deleted the hn/set-timeout-for-connection branch March 30, 2026 02:51
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