-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
errors.go
36 lines (32 loc) · 931 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package s3
import (
argos3 "github.com/argoproj/pkg/s3"
log "github.com/sirupsen/logrus"
"github.com/argoproj/argo-workflows/v3/util/errors"
)
// s3TransientErrorCodes is a list of S3 error codes that are transient (retryable)
// Reference: https://github.com/minio/minio-go/blob/92fe50d14294782d96402deb861d442992038109/retry.go#L90-L102
var s3TransientErrorCodes = []string{
"RequestError",
"RequestTimeout",
"Throttling",
"ThrottlingException",
"RequestLimitExceeded",
"RequestThrottled",
"InternalError",
"SlowDown",
"ServiceUnavailable",
}
// isTransientS3Err checks if an minio.ErrorResponse error is transient (retryable)
func isTransientS3Err(err error) bool {
if err == nil {
return false
}
for _, transientErrCode := range s3TransientErrorCodes {
if argos3.IsS3ErrCode(err, transientErrCode) {
log.Errorf("Transient S3 error: %v", err)
return true
}
}
return errors.IsTransientErr(err)
}