Skip to content

Commit f8033dd

Browse files
Merge pull request #9966 from tthvo/CORS-4078
CORS-4078: bump AWS SDK v2 max backoff duration to 300s
2 parents 8fdf0bb + b1301cd commit f8033dd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/asset/installconfig/aws/sessionv2.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path/filepath"
88
"sync"
9+
"time"
910

1011
survey "github.com/AlecAivazis/survey/v2"
1112
"github.com/aws/aws-sdk-go-v2/aws"
@@ -31,6 +32,9 @@ const (
3132

3233
// RetryMaxAttempts is the total number of times an API request is retried.
3334
RetryMaxAttempts = 25
35+
36+
// RetryBackoffDuration is max duration between retried attempts.
37+
RetryBackoffDuration = 300 * time.Second
3438
)
3539

3640
var (
@@ -47,6 +51,12 @@ func getDefaultConfigOptions() ConfigOptions {
4751
return retry.NewStandard(func(so *retry.StandardOptions) {
4852
so.MaxAttempts = RetryMaxAttempts
4953

54+
// The SDK v2 implements exponential backoff and jitter by default, but with 20s max backoff duration,
55+
// which can cause the installer to aggressively retry.
56+
// Thus, setting this to a higher value to allow more rest time and ease AWS API load.
57+
// In SDK v1, this value was also 300s: https://github.com/hashicorp/terraform-provider-aws/issues/36837
58+
so.Backoff = retry.NewExponentialJitterBackoff(RetryBackoffDuration)
59+
5060
// The SDK v2 introduces a new client-side rate-limiting mechanism in the standard retry.
5161
// The default settings are not a good fit for the installer, especially the destroy code.
5262
// Until we figure out a good settings, we disable it to align with SDK v1 behavior.

0 commit comments

Comments
 (0)