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

chore(armclient): removing 429 sdk retries in favor of controller retries #13

Merged
merged 5 commits into from
Nov 8, 2023
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
21 changes: 5 additions & 16 deletions pkg/utils/opts/armopts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -35,21 +34,11 @@ 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 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,
Bryce-Soghigian marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down