Show concurrency limit on WebUI queue page and in queue_counts table#216
Open
Show concurrency limit on WebUI queue page and in queue_counts table#216
Conversation
… query table Add max_concurrency and limit_type columns to the queue_counts query table so the current concurrency limit for each queue is queryable via SQL. For floating limits, the value comes from the persisted FloatingLimitState. For fixed limits, it is resolved from job info via a concurrency request or lease lookup. The WebUI /queue?name=xyz page now displays the concurrency limit, type (fixed/floating), and utilization (holders / max) in a summary bar. This works across local and remote shards since it uses the cluster query engine. Also adds regression tests for both fixed and floating concurrency limits in the queue_counts table, and benchmarks for the queue_counts queries used by the WebUI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Instead of scanning floating limit state keys and job info from the DB to resolve concurrency limits in the queue_counts table, maintain an in-memory cache in ConcurrencyManager that is populated during enqueue, grant_next, and floating limit refresh. This eliminates per-queue DB scans (request prefix scan, lease lookup, job info read) from the query path, making queue_counts queries purely in-memory for limit resolution. Changes: - Add CachedQueueLimit and ConcurrencyLimitType to ConcurrencyManager - Cache limits during handle_enqueue (fixed + floating), grant_next, handle_request_ticket_task, and report_refresh_success - QueueCountsScanner reads from snapshot_queue_limits() instead of DB - Remove now-unused floating_limits_prefix/tenant_prefix key helpers - Add holder-only test case (no requesters, limit resolved from cache) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Summary
max_concurrency(nullable Int64) andlimit_type(nullable Utf8, "fixed"/"floating") columns to thequeue_countsquery table/queue?name=xyzpage now shows the current concurrency limit, type, and utilization in a summary barFloatingLimitState; for fixed limits, resolves from job info via concurrency request or lease lookupTest plan
queue_counts(fixed, floating, and mixed queues)queue_countsqueries inquery_performance.rs🤖 Generated with Claude Code
Note
Medium Risk
Touches enqueue/grant/refresh concurrency paths to populate a new in-memory limit cache used by queries, so mistakes could surface incorrect limits or add contention on hot paths. Changes are additive and guarded (nullable columns), but impact both runtime concurrency management and query/UI output.
Overview
queue_countsnow exposes two new nullable columns:max_concurrencyandlimit_type(fixed/floating), sourced from a new in-memory limit cache rather than DB scans.Concurrency code paths (enqueue,
process_ticket_request_task/grant scanner, and floating-limit refresh success) now populate/snapshot this cache, and the WebUI queue detail page queriesqueue_countsto show the current limit, type, and utilization. Adds regression tests covering fixed/floating/multi-queue cases plus benchmark queries for the updatedqueue_countstable.Written by Cursor Bugbot for commit 5e5f4f8. This will update automatically on new commits. Configure here.