diff --git a/s3/retry.go b/s3/retry.go index 84185b40..6a278d52 100644 --- a/s3/retry.go +++ b/s3/retry.go @@ -43,7 +43,8 @@ func NewClient(rt *ResilientTransport) *http.Client { } return c, nil }, - Proxy: http.ProxyFromEnvironment, + DisableKeepAlives: true, + Proxy: http.ProxyFromEnvironment, } // TODO: Would be nice is ResilientTransport allowed clients to initialize // with http.Transport attributes. @@ -77,6 +78,9 @@ func (t *ResilientTransport) tries(req *http.Request) (res *http.Response, err e if !t.ShouldRetry(req, res, err) { break } + if try == MaxTries-1 { + break + } if res != nil { res.Body.Close() }