| 115 | class ShortRetryStrategy : public S3RetryStrategy { |
| 116 | public: |
| 117 | bool ShouldRetry(const AWSErrorDetail& error, int64_t attempted_retries) override { |
| 118 | if (error.message.find(kFileExistsMessage) != error.message.npos) { |
| 119 | // Minio returns "file exists" errors (when calling mkdir) as internal errors, |
| 120 | // which would trigger spurious retries. |
| 121 | return false; |
| 122 | } |
| 123 | return IsRetryable(error) && (attempted_retries * kRetryInterval < kMaxRetryDuration); |
| 124 | } |
| 125 | |
| 126 | int64_t CalculateDelayBeforeNextRetry(const AWSErrorDetail& error, |
| 127 | int64_t attempted_retries) override { |