From fa48b880c2dc27ce5c3bc38b5b84bac95e2b271e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 24 Nov 2021 12:48:57 +0000 Subject: [PATCH] s3: retry RequestTimeout errors See: https://forum.rclone.org/t/s3-failed-upload-large-files-bad-request-400/27695 --- backend/s3/s3.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index ac5e112cb..dd894db18 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -2121,6 +2121,10 @@ func (f *Fs) shouldRetry(ctx context.Context, err error) (bool, error) { if fserrors.ShouldRetry(awsError.OrigErr()) { return true, err } + // If it is a timeout then we want to retry that + if awsError.Code() == "RequestTimeout" { + return true, err + } // Failing that, if it's a RequestFailure it's probably got an http status code we can check if reqErr, ok := err.(awserr.RequestFailure); ok { // 301 if wrong region for bucket - can only update if running from a bucket