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

feat: Configurable retry backoff settings when retrying API calls #4979

Merged
merged 3 commits into from Feb 2, 2021
Merged

feat: Configurable retry backoff settings when retrying API calls #4979

merged 3 commits into from Feb 2, 2021

Conversation

terrytangyuan
Copy link
Member

@terrytangyuan terrytangyuan commented Jan 30, 2021

This allows us to configure the settings for different clusters dynamically based on conditions of those clusters (e.g. current load and available resources) when encountering transient errors.

Signed-off-by: terrytangyuan terrytangyuan@gmail.com

Checklist:

util/retry/retry.go Outdated Show resolved Hide resolved
util/retry/retry.go Outdated Show resolved Hide resolved
util/retry/retry.go Outdated Show resolved Hide resolved
@alexec alexec self-assigned this Feb 1, 2021
@@ -16,3 +16,21 @@ func TestLookupEnvDurationOr(t *testing.T) {
_ = os.Setenv("FOO", "1h")
assert.Equal(t, time.Hour, LookupEnvDurationOr("FOO", time.Second), "env var value")
}

func TestLookupEnvIntOr(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Factor: 2,
var DefaultRetry wait.Backoff

func init() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you even need init now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Removed.

Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work

@alexec alexec merged commit ce508c8 into argoproj:master Feb 2, 2021
@terrytangyuan terrytangyuan deleted the backoff-settings branch February 2, 2021 20:41
@simster7 simster7 mentioned this pull request Feb 8, 2021
38 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants