Skip to content

test(rpc): Show that some RPC endpoints never release their concurrency slot - #8625

Open
dezzeddi wants to merge 4 commits into
masterfrom
dani/rpc-release-policy-slots
Open

dezzeddi wants to merge 4 commits into
masterfrom
dani/rpc-release-policy-slots

Conversation

@dezzeddi

@dezzeddi dezzeddi commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Adds a test showing that RPC endpoints which never record a query result don't release their concurrency slot. The leaking case fails on master.

  • With ConcurrentRateLimitAllocationPolicy at a limit of 1, a second trace item table request runs (passes).
  • A second trace item attribute names request is rejected, because the first one still holds its slot (fails).

update_allocation_policies_balances only ran when an endpoint recorded a
query_result or the error was a QueryException / RPCAllocationPolicyException.
Every request takes a concurrency slot in get_quota_allowance, so endpoints
that never set query_result (GetTrace, GetTraces, TraceItemDetails,
ExportTraceItems, DeleteTraceItems, AttributeNames, AttributeValues,
CreateSubscription) and every timeout (re-raised as an RPCRequestException)
held their slot until max_query_duration_s expired.

Run the update for every request, with a zero-bytes placeholder result when
the endpoint recorded none. Also keep the ClickHouse error as the cause of the
re-raised timeout so BytesScannedRejectingPolicy charges its timeout penalty.
…cy slot

With a concurrency limit of 1, a second trace item table request runs, but a
second attribute names request is rejected because the first one, which never
records a query result, still holds its slot.
@dezzeddi dezzeddi changed the title fix(rpc): Always run allocation policy updates after an RPC request test(rpc): Show that some RPC endpoints never release their concurrency slot Nov 3, 2026
@dezzeddi
dezzeddi marked this pull request as ready for review November 3, 2026 23:43
@dezzeddi
dezzeddi requested review from a team as code owners November 3, 2026 23:43

This branch has not been deployed

No deployments
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