fix: bound forwards by the configured timeout and close proxy response body - #21
Draft
MoeMahhouk wants to merge 1 commit into
Draft
fix: bound forwards by the configured timeout and close proxy response body#21MoeMahhouk wants to merge 1 commit into
MoeMahhouk wants to merge 1 commit into
Conversation
…e bodies -request-timeout/-proxy-request-timeout previously only set the dialer timeout, so a connected-but-slow backend hung a forward indefinitely. Forwards now carry a detached context bounded by the configured timeout (plus Transport.ResponseHeaderTimeout). Also drain and close response bodies in the fire-and-forget proxy path, which previously leaked them.
4 tasks
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
-request-timeout/-proxy-request-timeoutpreviously only set the dialer timeout, so a connected-but-slow backend could hang a forward indefinitely.Forwards now carry a detached context bounded by the configured timeout (plus
Transport.ResponseHeaderTimeout), and a backend that misses the deadline is treated as failed, with fallback to the next builder. Also drains and closes response bodies in the fire-and-forget peer-proxy path, which previously leaked them.⛱ Motivation and Context
Groundwork for running sync-proxy behind an nginx mirror: async forwards must be time-bounded so they cannot pile up against a hung EL. Two follow-up PRs (mirror mode, metrics) are stacked on this branch.
📚 References
✅ I have run these commands
make lintmake test-racego mod tidyCONTRIBUTING.md