Conversation
- Error-type-aware backoff: throttle=1s base, transient=50ms base - Updated token costs: transient=14, throttle=5 - x-amz-retry-after header parsing with clamping - DynamoDB/DynamoDB Streams tuning: 25ms transient base, 4 max attempts - Long-polling backoff delay via IsLongPollingOperation() on request - Default retry mode set to "standard" when gate active - Service-specific tuning gated (maxAttempts/backoff only apply when gate on) - Shared LongPollingRetryHelper to eliminate duplication between client paths
sbiscigl
reviewed
Jun 19, 2026
| this->configFactories.retryStrategyCreateFn = []() -> std::shared_ptr<Client::RetryStrategy> { | ||
| return Client::InitRetryStrategy(4, "", 0.025); | ||
| }; | ||
| #if defined(_MSC_VER) |
Collaborator
There was a problem hiding this comment.
Collaborator
Author
There was a problem hiding this comment.
So this codegen is from a preexisting codegen template that funnily, I had added, PR. All we did in this PR was add dynamodbstreams to the codegen path.
| if (Aws::Utils::StringUtils::ToLower(Aws::Environment::GetEnv("AWS_NEW_RETRIES_2026").c_str()) != "true") | ||
| { | ||
| // Gate is off: ignore service-specific tuning, use default behavior | ||
| return InitRetryStrategy(-1, retryMode); |
Collaborator
There was a problem hiding this comment.
why -1 ? why not call the constructor that just takes the retry mode?
| const std::shared_ptr<RetryStrategy>& retryStrategy, | ||
| bool isLongPollingOperation) | ||
| { | ||
| if (!isLongPollingOperation) return 0; |
Collaborator
There was a problem hiding this comment.
nit 4 if statements after one another is kind of weird, why not
if (!isLongPollingOperation &&
!error.ShouldRetry() &&
retries + 1 >= retryStrategy->GetMaxAttempts()) {
return 0;
}|
|
||
| if (!retryWithCorrectRegion && !m_retryStrategy->ShouldRetry(outcome.GetError(), retries)) | ||
| { | ||
| long lpSleepMs = Internal::ComputeLongPollingSleepMs( |
Collaborator
There was a problem hiding this comment.
think we need to gate this with the env var too
| return InitRetryStrategy(maxAttempts, retryMode); | ||
| } | ||
|
|
||
| long attempts = (maxAttempts < 0) ? 3 : static_cast<long>(maxAttempts); |
Collaborator
There was a problem hiding this comment.
lets just pass down max attempts, ifs negative we shouldnt check for the invariant this high in the call path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
Implement Retry Behavior 2.1 core logic gated behind AWS_NEW_RETRIES_2026
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.