diff options
Diffstat (limited to 'retry.go')
-rw-r--r-- | retry.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -26,7 +26,7 @@ import ( ) // MaxRetry is the maximum number of retries before stopping. -var MaxRetry = 5 +var MaxRetry = 10 // MaxJitter will randomize over the full exponential backoff time const MaxJitter = 1.0 @@ -111,6 +111,9 @@ func isNetErrorRetryable(err error) bool { } else if strings.Contains(err.Error(), "connection timed out") { // If err is a net.Dial timeout, retry. return true + } else if strings.Contains(err.Error(), "net/http: HTTP/1.x transport connection broken") { + // If error is transport connection broken, retry. + return true } } } @@ -128,6 +131,7 @@ var retryableS3Codes = map[string]struct{}{ "InternalError": {}, "ExpiredToken": {}, "ExpiredTokenException": {}, + "SlowDown": {}, // Add more AWS S3 codes here. } |