Surface queue rate limited state in TaskQueueStats#10944
Draft
rkannan82 wants to merge 4 commits into
Draft
Conversation
Per-fairness-key rate limiting should not suppress WCI scaling because other keys may still need workers. Only whole-queue rate limits indicate that adding more workers genuinely cannot help. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SyncMatchOutcomeFairnessKeyRateLimited to hook enum instead of collapsing per-key rate limiting into NotMatched. Let hooks decide how to handle each outcome. - Rename syncMatchPerKeyRateLimited to syncMatchFairnessKeyRateLimited. - Use switch in MatchTaskImmediately so new enum values are handled explicitly. - Replace wholeQueueLimited bool return from findMatch with a rateLimitKind enum for a clearer API. - Remove hook-consumer-specific references from comments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add IsWholeQueueRateLimitingActive() to rateLimitManager and populate RateLimitingActive on stats entries in GetStatsByPriority(). MergeStats ORs the boolean across partitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39ad6e8 to
3d53eb1
Compare
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.
What
Populates the new
rate_limiting_activefield inTaskQueueStatsso auto-scaling systems can detect when backlog growth is caused by rate limiting rather than insufficient worker capacity.Why
When a task queue has a whole-queue rate limit configured, WorkerControllerInterface (WCI)
PullStatspath sees backlog and scales up workers. More workers don't help — they poll but can't receive tasks faster than the rate limit. This field lets WCI suppress scaling in that case.How did you test it?
IsWholeQueueRateLimitingActive— verifies whole-queue rate limit is detected, per-key-only is not🤖 Generated with Claude Code