From 3b065eeb7d94ceb6ce1a9a6fc8867401215efcdc Mon Sep 17 00:00:00 2001 From: Rached Ben Mustapha Date: Thu, 4 Feb 2016 23:10:15 +0000 Subject: [PATCH] s3: Disable keepalive on minio HTTP client This avoids connections being used for too long and being terminated by the S3 endpoint. --- backend/s3/s3.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index ccb6cd42c..3c2d88770 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "io" + "net/http" "strings" "github.com/minio/minio-go" @@ -39,6 +40,11 @@ func Open(cfg Config) (backend.Backend, error) { return nil, err } + tr := &http.Transport{ + DisableKeepAlives: true, + } + client.SetCustomTransport(tr) + be := &s3{client: client, bucketname: cfg.Bucket} be.createConnections()