From e2e347fe43b32dab4d312b8e29f5db5e02233999 Mon Sep 17 00:00:00 2001 From: bsoghigian Date: Tue, 7 Nov 2023 16:12:11 -0800 Subject: [PATCH 1/2] chore(armclient): removing 429 sdk retries in favor of provider retries --- pkg/utils/opts/armopts.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/pkg/utils/opts/armopts.go b/pkg/utils/opts/armopts.go index 68e5834d9..aca2aaaf6 100644 --- a/pkg/utils/opts/armopts.go +++ b/pkg/utils/opts/armopts.go @@ -18,7 +18,6 @@ package opts import ( "net/http" - "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" @@ -35,21 +34,7 @@ func DefaultArmOpts() *arm.ClientOptions { func DefaultRetryOpts() policy.RetryOptions { return policy.RetryOptions{ - MaxRetries: 20, - // Note the default retry behavior is exponential backoff - RetryDelay: time.Second * 5, - // TODO: bsoghigian: Investigate if we want to leverage some of the status codes other than the defaults. - // the defaults are // StatusCodes specifies the HTTP status codes that indicate the operation should be retried. - // A nil slice will use the following values. - // http.StatusRequestTimeout 408 - // http.StatusTooManyRequests 429 - // http.StatusInternalServerError 500 - // http.StatusBadGateway 502 - // http.StatusServiceUnavailable 503 - // http.StatusGatewayTimeout 504 - // Specifying values will replace the default values. - // Specifying an empty slice will disable retries for HTTP status codes. - // StatusCodes: nil, + MaxRetries: -1, } } From d0d4386e5b86920d0f19959d370ef16d478f9c25 Mon Sep 17 00:00:00 2001 From: bsoghigian Date: Tue, 7 Nov 2023 16:31:08 -0800 Subject: [PATCH 2/2] style(clientopts): adding comment explaining sdk for go retry behavior --- pkg/utils/opts/armopts.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/utils/opts/armopts.go b/pkg/utils/opts/armopts.go index aca2aaaf6..75ff4bc4e 100644 --- a/pkg/utils/opts/armopts.go +++ b/pkg/utils/opts/armopts.go @@ -34,6 +34,10 @@ func DefaultArmOpts() *arm.ClientOptions { func DefaultRetryOpts() policy.RetryOptions { return policy.RetryOptions{ + // MaxRetries specifies the maximum number of attempts a failed operation will be retried + // before producing an error. + // The default value is three. A value less than zero means one try and no retries. + // See Reference here: https://github.com/Azure/azure-sdk-for-go/blob/v61.4.0/sdk/azcore/policy/policy.go#L73 MaxRetries: -1, } }