Skip to content

Commit

Permalink
Retry throttling errors, disable retry rate-limiting
Browse files Browse the repository at this point in the history
  • Loading branch information
cPu1 committed Jul 10, 2024
1 parent d0829b1 commit 07324eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/eks/retryer_v2.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package eks

import (
"errors"
"net/http"

"github.com/aws/aws-sdk-go-v2/aws"

"github.com/aws/aws-sdk-go-v2/aws/retry"

"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/smithy-go"
"github.com/pkg/errors"
)

const (
Expand Down Expand Up @@ -39,7 +38,10 @@ func (r *RetryerV2) IsErrorRetryable(err error) bool {
}

var oe *smithy.OperationError
return errors.As(err, &oe) && oe.Err != nil && isErrorRetryable(oe.Err)
if !errors.As(err, &oe) {
return true
}
return oe.Err != nil && isErrorRetryable(oe.Err)
}

func isErrorRetryable(err error) bool {
Expand Down
2 changes: 2 additions & 0 deletions pkg/eks/services_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sync"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/ratelimit"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/service/cloudformation"
"github.com/aws/aws-sdk-go-v2/service/ec2"
Expand Down Expand Up @@ -85,6 +86,7 @@ func (s *ServicesV2) CloudFormation() awsapi.CloudFormation {
o.StandardOptions = []func(*retry.StandardOptions){
func(so *retry.StandardOptions) {
so.MaxAttempts = maxRetries
so.RateLimiter = ratelimit.None
},
}
})
Expand Down

0 comments on commit 07324eb

Please sign in to comment.