Repository navigation
Conversation
ConcurrentRateLimitAllocationPolicy, ReferrerGuardRailPolicy and CrossOrgQueryAllocationPolicy each re-implemented the same count-check-end flow. BaseConcurrentRateLimitAllocationPolicy now runs it; subclasses supply the bucket and limit, which queries they skip, and how a decision becomes an allowance. Buckets, limits, explanations and decisions are unchanged.
Member
Author
|
Combined into #8643. |
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.
ConcurrentRateLimitAllocationPolicy (CRL), ReferrerGuardRailPolicy (RGR) and CrossOrgQueryAllocationPolicy (XO) each re-implement the same flow: skip some queries, count the query in a Redis bucket, compare with a limit, end the query afterwards.
BaseConcurrentRateLimitAllocationPolicynow runs that flow (_get_quota_allowance,_update_quota_balance). Subclasses supply hooks:_rate_limit_params: bucket and limit_pass_through_allowance/_skips_balance_update: queries they don't count_allowance: how the decision becomes aQuotaAllowance(RGR's throttling stays here)Zero behaviour change: buckets, limits, explanations, metrics and decisions are the same. Two details kept on purpose:
Conflicts with #8634, #8635, #8636 and #8637 (same files); whichever merges second needs a rebase.