Skip to content

Commit 261beac

Browse files
committed
Add support for configurable token bucket success reward and fractional token management
Adding support for atomic float Adding support for atomic float
1 parent 80e9ab4 commit 261beac

File tree

3 files changed

+386
-10
lines changed

3 files changed

+386
-10
lines changed

.changelog/1763060740.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
applies_to:
3+
- client
4+
authors:
5+
- annahay
6+
references: []
7+
breaking: false
8+
new_feature: true
9+
bug_fix: false
10+
---
11+
Add support for configurable token bucket success reward and fractional token management

rust-runtime/aws-smithy-runtime/src/client/retries/strategy/standard.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,11 @@ impl RetryStrategy for StandardRetryStrategy {
210210
.unwrap_or(false);
211211
update_rate_limiter_if_exists(runtime_components, cfg, is_throttling_error);
212212

213-
// on success release any retry quota held by previous attempts
213+
// on success release any retry quota held by previous attempts and award success tokens
214214
if !ctx.is_failed() {
215+
// When a request succeeds, we grant an award, if present
216+
token_bucket.reward_success();
217+
215218
if let NoPermitWasReleased = self.release_retry_permit() {
216219
// In the event that there was no retry permit to release, we generate new
217220
// permits from nothing. We do this to make up for permits we had to "forget".

0 commit comments

Comments
 (0)