fix: set timeouts on the upstream HTTP client #83
Reference in New Issue
Block a user
Delete Branch "benvin/upstream-http-timeouts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #67
Why
The proxy used
http.DefaultClientfor all upstream GET/HEAD and bearer-token requests. It has no timeouts, so a slow or hung upstream holds a goroutine and connection indefinitely.Changes
upstreamClient(internal/proxy/httpclient.go) with dial, TLS-handshake, response-header and idle-connection timeouts, plus connection pooling.Client.Timeout, so large artifact bodies can still stream; total time is bounded by the request context.Validation
make e2epasses.Extended per review feedback: the dial/TLS/response-header timeouts remain the defaults, and are now overridable per-remote via
upstream_dial_timeout/upstream_tls_timeout/upstream_response_header_timeout(seconds; 0 = default). Clients are cached by timeout set so remotes sharing a config share a connection pool. New e2e testTestRemoteUpstreamTimeoutscovers the round-trip;make e2epasses.