Skip to content

fix: bound forwards by the configured timeout and close proxy response body - #21

Draft
MoeMahhouk wants to merge 1 commit into
mainfrom
moe/bounded-request-timeouts
Draft

fix: bound forwards by the configured timeout and close proxy response body#21
MoeMahhouk wants to merge 1 commit into
mainfrom
moe/bounded-request-timeouts

Conversation

@MoeMahhouk

Copy link
Copy Markdown
Member

📝 Summary

-request-timeout / -proxy-request-timeout previously 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 lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

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