Skip to content

Commit

Permalink
fix: Retry for http timeout error. Fixes #9271
Browse files Browse the repository at this point in the history
Signed-off-by: Jingkai Hung <[email protected]>
  • Loading branch information
jingkkkkai committed Aug 15, 2022
1 parent 1b252fd commit d4e9621
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion workflow/artifacts/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/argoproj/argo-workflows/v3/errors"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
errutil "github.com/argoproj/argo-workflows/v3/util/errors"
waitutil "github.com/argoproj/argo-workflows/v3/util/wait"
"github.com/argoproj/argo-workflows/v3/workflow/artifacts/common"
)
Expand All @@ -38,7 +39,7 @@ var (

// from https://github.com/googleapis/google-cloud-go/blob/master/storage/go110.go
func isTransientGCSErr(err error) bool {
if err == io.ErrUnexpectedEOF {
if err == io.ErrUnexpectedEOF || errutil.IsTransientErr(err) {
return true
}
switch e := err.(type) {
Expand Down
4 changes: 4 additions & 0 deletions workflow/artifacts/oss/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/argoproj/argo-workflows/v3/errors"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
errutil "github.com/argoproj/argo-workflows/v3/util/errors"
waitutil "github.com/argoproj/argo-workflows/v3/util/wait"
"github.com/argoproj/argo-workflows/v3/workflow/artifacts/common"
wfcommon "github.com/argoproj/argo-workflows/v3/workflow/common"
Expand Down Expand Up @@ -250,6 +251,9 @@ func isTransientOSSErr(err error) bool {
if err == nil {
return false
}
if errutil.IsTransientErr(err) {
return true
}
if ossErr, ok := err.(oss.ServiceError); ok {
for _, transientErrCode := range ossTransientErrorCodes {
if ossErr.Code == transientErrCode {
Expand Down

0 comments on commit d4e9621

Please sign in to comment.