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

Updated RLQS Response handling to not reset TokenBucket state #36478

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

bsurber
Copy link
Contributor

@bsurber bsurber commented Oct 7, 2024

Commit Message: When an RLQS response comes in that would create a duplicate TokenBucket (because the underlying config hasn't changed), treat this as a refresh to the TTL but don't reset the TokenBucket's state by recreating it.
Additional Description:
Risk Level: Low
Testing: Unit testing
Docs Changes:
Release Notes:
Platform Specific Features:

… hasn't actually changed its config, otherwise token state will always reset

Signed-off-by: Brian Surber <[email protected]>
@tyxia tyxia self-assigned this Oct 7, 2024
… case's handling to be consistent across all actions

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

@tyxia tyxia left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

PTAL at CI build failure which is real.

@@ -77,6 +77,20 @@ void RateLimitClientImpl::sendUsageReport(absl::optional<size_t> bucket_id) {
stream_->sendMessage(buildReport(bucket_id), /*end_stream=*/false);
}

bool cacheHasTokenBucket(const ::envoy::type::v3::TokenBucket& token_bucket,
Copy link
Member

Choose a reason for hiding this comment

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

This function is not used. Remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up, thanks.

@tyxia
Copy link
Member

tyxia commented Oct 8, 2024

/wait

Copy link
Member

@tyxia tyxia left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@tyxia tyxia merged commit 58abcf7 into envoyproxy:main Oct 8, 2024
20 checks passed
anitabyte pushed a commit to anitabyte/envoy that referenced this pull request Oct 9, 2024
…nvoyproxy#36478)

Commit Message: When an RLQS response comes in that would create a
duplicate TokenBucket (because the underlying config hasn't changed),
treat this as a refresh to the TTL but don't reset the TokenBucket's
state by recreating it.
Additional Description:
Risk Level: Low
Testing: Unit testing
Docs Changes:
Release Notes:
Platform Specific Features:

---------

Signed-off-by: Brian Surber <[email protected]>
Signed-off-by: anitabyte <[email protected]>
Stevenjin8 pushed a commit to Stevenjin8/envoy that referenced this pull request Oct 10, 2024
…nvoyproxy#36478)

Commit Message: When an RLQS response comes in that would create a
duplicate TokenBucket (because the underlying config hasn't changed),
treat this as a refresh to the TTL but don't reset the TokenBucket's
state by recreating it.
Additional Description:
Risk Level: Low
Testing: Unit testing
Docs Changes:
Release Notes:
Platform Specific Features:

---------

Signed-off-by: Brian Surber <[email protected]>
Signed-off-by: Steven Jin Xuan <[email protected]>
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.

2 participants