Skip to content

Commit

Permalink
Also retry initial mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Aug 5, 2024
1 parent 483e2d0 commit 983bd0e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/backend_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,21 @@ func (s *S3Backend) detectBucketLocationByHEAD() (err error, isAws bool) {
}

func (s *S3Backend) testBucket(key string) (err error) {
_, err = s.HeadBlob(&HeadBlobInput{Key: key})
oldAttempts := s.flags.ReadRetryAttempts
if oldAttempts == 0 {
// Never wait infinitely for init
s.flags.ReadRetryAttempts = 5
}
err = ReadBackoff(s.flags, func(attempt int) error {
_, err := s.HeadBlob(&HeadBlobInput{Key: key});
return err
})
if err != nil {
if mapAwsError(err) == syscall.ENOENT {
err = nil
}
}

s.flags.ReadRetryAttempts = oldAttempts
return
}

Expand Down

0 comments on commit 983bd0e

Please sign in to comment.