Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws: Fix awsup default and DescribeTag max retries #16887

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions upup/pkg/fi/cloudup/awsup/aws_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import (
"k8s.io/kops/util/pkg/awsinterfaces"
)

// By default, aws-sdk-go only retries 3 times, which doesn't give
// By default, aws-sdk-go-v2 only retries 3 times, which doesn't give
// much time for exponential backoff to work for serious issues. At 13
// retries, we'll try a given request for up to ~6m with exponential
// backoff along the way.
Expand Down Expand Up @@ -279,7 +279,11 @@ func loadAWSConfig(ctx context.Context, region string) (aws.Config, error) {
awsconfig.WithClientLogMode(aws.LogRetries),
awsconfig.WithLogger(awsLogger{}),
awsconfig.WithRetryer(func() aws.Retryer {
return retry.NewAdaptiveMode()
return retry.NewAdaptiveMode(func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = ClientMaxRetries
})
})
}),
}

Expand Down Expand Up @@ -1271,7 +1275,9 @@ func getTags(c AWSCloud, resourceID string) (map[string]string, error) {
for {
attempt++

response, err := c.EC2().DescribeTags(ctx, request)
response, err := c.EC2().DescribeTags(ctx, request, func(o *ec2.Options) {
o.RetryMaxAttempts = DescribeTagsMaxAttempts
})
if err != nil {
if isTagsEventualConsistencyError(err) {
if attempt > DescribeTagsMaxAttempts {
Expand Down
Loading