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

fix: remove maxTime from StandardRetryStrategy #624

Merged
merged 1 commit into from
Apr 7, 2022
Merged

Conversation

aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Apr 6, 2022

Issue #

fixes: awslabs/aws-sdk-kotlin#572

Description of changes

Removes a maximum per/operation timeout from the StandardRetryStrategy. There is no sensible default for this timeout since an operation could involve a large request stream. It also subjected operations to timeout in highly concurrent environments with lots of coroutines if the coroutine was starved and just didn't get a chance to run.

Users can still impose timeouts for any given operation with the built-in withTimeout functionality, e.g.

// timeout for the whole operation to complete (including all retries)
withTimeout(myTimeout) {
    client.fooOperation(...)
}


// timeout for a waiter to complete
withTimeout(myTimeout) {
    client.waitForFooExist(...)
}

Waiters were previously hard coded to 5 min as an absolute timeout. This appears to be arbitrary and nothing in the waiter spec dictates a maximum timeout configuration option. Waiters will still be bounded by maximum attempts (which transitively places an upper bound on time).

I also did a minor cleanup and set defaults for the StandardRetryStrategy such that we don't have to codegen the options, token bucket, and delay provider when they don't need to deviate from the default.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Removes a maximum per/operation timeout from the StandardRetryStrategy.
There is no sensible default for this timeout since an operation could
involve a large request stream. It also subjected operations to timeout
in highly concurrent environments with lots of coroutines if the
coroutine was starved and just didn't get a chance to run.

fixes: awslabs/aws-sdk-kotlin/issues/572
@aajtodd aajtodd requested a review from a team as a code owner April 6, 2022 16:41
@aajtodd aajtodd requested review from ianbotsf and lucix-aws April 6, 2022 16:42
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 6, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
10.0% 10.0% Duplication

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.

How to set custom timeout duration?
2 participants