fix: raise the proxy and tunnel read and write timeouts to 120s - #450
Merged
Conversation
📝 WalkthroughWalkthroughThe proxy adds read and write timeout flags, validates and applies them when creating HTTP servers, adjusts header deadlines, and routes reverse-proxy server creation through the new helper. Response-writer unwrapping and tests cover streaming, hijacking, and timeout behavior. ChangesProxy timeout and response handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant registerConfigFlags
participant newServer
participant http.Server
participant ReverseProxy
CLI->>registerConfigFlags: configure read-timeout and write-timeout
registerConfigFlags->>newServer: pass timeout durations
newServer->>http.Server: apply read, header, and write deadlines
ReverseProxy->>http.Server: serve proxied request
http.Server-->>ReverseProxy: enforce configured response deadline
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
alnr
force-pushed
the
fix/302-proxy-timeouts
branch
from
July 29, 2026 13:34
d7745c3 to
35d63ab
Compare
graceful.WithDefaults applies a 5s read and 10s write timeout, which cut slower exchanges off mid-flight and left the client with an empty reply rather than an error. The upstream is the developer's own application and may legitimately take longer. Closes #302 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JYzGVwAKQ4ormxRHZg1eDu
alnr
force-pushed
the
fix/302-proxy-timeouts
branch
from
July 29, 2026 13:37
35d63ab to
b4740f3
Compare
aeneasr
approved these changes
Jul 29, 2026
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.
Closes #302
graceful.WithDefaultsapplies a 5s read and 10s write timeout to the proxy and tunnel server. Any exchange slower than that was cut off mid-flight, so the client got an empty reply with no status and no error:The reporter's observed 9.5s-works / 10.5s-fails boundary matches the 10s write deadline exactly. The read timeout caused the same silent truncation for slow or large request bodies. The upstream here is the developer's own application and may legitimately take longer than either.
Raises both to 120s.
graceful.WithDefaultsonly fills in zero values, so non-zero values set on the server pass through untouched.Note that
ReadHeaderTimeoutstays at graceful's 5s, sincenet/httpprefers it overReadTimeoutfor the header phase — request headers still have to arrive promptly, while the body now gets the full 120s.🤖 Generated with Claude Code
https://claude.ai/code/session_01JYzGVwAKQ4ormxRHZg1eDu