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

Initialize rate_limit_quota token buckets with a partial fill #37624

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bsurber
Copy link
Contributor

@bsurber bsurber commented Dec 12, 2024

Commit Message: When replacing a token bucket with another in a rate_limit_quota filter's bucket cache, initialize the replacement in a partially filled state, based on the ratio of available and max tokens of the existing token bucket.

Additional Description: This enables more frequent updates in RateLimitQuotaResponses when giving assignments for token buckets. Previously, updates to an assignment had a side effect of resetting the available tokens in the token bucket. This implementation doesn't perfectly account for asynchronous flows but is better than the implementation.

Risk Level: Low - the AtomicTokenBucketImpl class isn't widely used yet & changes are minimal. The rate_limit_quota filter is still in development.
Testing: Integration testing
Docs Changes:
Release Notes:
Platform Specific Features:

… ratio of available to max tokens as an existing TB, if present.

Signed-off-by: Brian Surber <[email protected]>
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #37624 was opened by bsurber.

see: more, trace.

@bsurber bsurber marked this pull request as ready for review December 12, 2024 00:51
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.

1 participant