Repository navigation
Conversation
…eams - Add common.NewOutboundHTTPTransport with dial/TLS/response-header timeouts - Relay/OAuth clients reuse the shared transport - Keep http.Client.Timeout unbounded so RELAY_TIMEOUT does not cut streaming body reads - SSRF-protected fetch builds transports via the same helper
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughRelay-specific HTTP timeout settings are added, loaded from the environment, and applied through a shared outbound transport factory. OAuth, service, proxy, and protected-fetch clients now reuse this transport while scoped client timeouts remain available for non-streaming requests. ChangesOutbound HTTP transport
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Application
participant ServiceHTTPClient
participant NewOutboundHTTPTransport
participant ProxyOrDialer
participant RemoteHTTPServer
Application->>ServiceHTTPClient: initialize outbound client
ServiceHTTPClient->>NewOutboundHTTPTransport: provide proxy or dial function
NewOutboundHTTPTransport->>ProxyOrDialer: configure connection dialing
ProxyOrDialer-->>NewOutboundHTTPTransport: return configured transport
ServiceHTTPClient->>RemoteHTTPServer: send request with transport timeouts
RemoteHTTPServer-->>ServiceHTTPClient: response headers or timeout
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@service/protected_fetch_client.go`:
- Line 72: Remove the client.Timeout assignment from
newProtectedFetchHTTPClientWithProxy, while preserving the RelayDialTimeout
setting on its transport dialer. Ensure this proxy client leaves response body
reads unbounded, matching the standard outbound HTTP client behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 667b24a7-4e28-4d07-8847-90f8e2533a72
📒 Files selected for processing (8)
.env.examplecommon/constants.gocommon/http_client.gocommon/http_client_test.gocommon/init.gooauth/http_client.goservice/http_client.goservice/protected_fetch_client.go
CodeRabbit #6300: newProtectedFetchHTTPClientWithProxy still applied RELAY_TIMEOUT to http.Client.Timeout, which covers response-body reads and aborts long-lived streams. Match newOutboundHTTPClient: dial timeout only; leave client.Timeout at 0.
|
Addressed CodeRabbit review:
Pushed: |
|
Withdrawing this contribution. No further action needed from maintainers. Closing and deleting the head branch. |
Summary
Fourth small PR from the withdrawn hardening effort: outbound HTTP client lifecycle.
Problem
Applying
RELAY_TIMEOUTashttp.Client.Timeoutcovers the entire request including response-body reads, so long-lived streaming completions get aborted mid-body.Change
common.NewOutboundHTTPTransportwith dial / TLS / response-header / idle / expect-continue timeoutshttp.Client.Timeout = 0for the general relay client; stall protection isResponseHeaderTimeout+ request contextGetHttpClientWithTimeoutEnv (optional)
RELAY_DIAL_TIMEOUT,RELAY_TLS_HANDSHAKE_TIMEOUT,RELAY_RESPONSE_HEADER_TIMEOUT,RELAY_EXPECT_CONTINUE_TIMEOUT(documented in.env.example).Test plan
go test ./common(outbound transport timeout tests)go test ./service -run 'Http|HTTP|Client|SSRF|Protected|Timeout|Transport|Outbound'RELAY_TIMEOUTwall while hung upstreams still time out on headersNotes
Summary by CodeRabbit
New Features
Bug Fixes
Documentation