Skip to content

Commit

Permalink
Merge pull request #692 from openshift-cherrypick-robot/cherry-pick-6…
Browse files Browse the repository at this point in the history
…90-to-release-4.5

[release-4.5] Bug 1970966: Using http.DefaultTransport timeouts
  • Loading branch information
openshift-merge-robot committed Jun 16, 2021
2 parents 558da05 + 2c59b84 commit 10ef375
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/storage/s3/s3.go
Expand Up @@ -3,9 +3,11 @@ package s3
import (
"context"
"fmt"
"net"
"net/http"
"net/url"
"reflect"
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
Expand Down Expand Up @@ -143,6 +145,16 @@ func (d *driver) getS3Service() (*s3.S3, error) {
Region: &d.Config.Region,
HTTPClient: &http.Client{
Transport: &http.Transport{
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
Proxy: func(req *http.Request) (*url.URL, error) {
return httpproxy.FromEnvironment().ProxyFunc()(req.URL)
},
Expand Down

0 comments on commit 10ef375

Please sign in to comment.