Repository navigation
Shrink idle thread pools of the distributed query infrastructure - #106978
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
|
Workflow [PR], commit [4d5062f] Summary: ❌
AI ReviewSummaryThis PR reduces retained idle threads in the distributed query test infrastructure by making Final VerdictStatus: ✅ Approve |
Algunenano
approved these changes
Jun 10, 2026
Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 19/21 (90.48%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 3 line(s) · Uncovered code |
davenger
enabled auto-merge
June 10, 2026 19:03
This was referenced Jun 11, 2026
ianton-ru
pushed a commit
to Altinity/ClickHouse
that referenced
this pull request
Jul 13, 2026
…-shrink-idle-thread-pools Shrink idle thread pools of the distributed query infrastructure
11 of 28 tasks
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.
Related: #106020
Changelog category (leave one):
Since the stateless worker endpoint and streaming exchange server were enabled in every stateless CI run, sanitizer jobs idle closer to their memory cap and OOM more often. The infrastructure retains idle threads for the server's lifetime, and under ASan each parked thread is expensive (instrumented stack pages, fake stack, allocator cache, shadow memory), none of it visible to the memory tracker.
Three sources of retained threads, addressed individually:
StatelessTaskExecutorkept up to 100 idle pool threads (observed: 35 parked for the whole run at ~0.1% utilization). The pool parameters are now configurable viastateless_worker_server.max_threads/max_free_threads/queue_size, and idle threads are not retained by default. SinceThreadPoolspawns threads on demand, this has no startup or steady-state cost.ExchangeServerhandshake pool kept 8 idle threads; handshakes are short-lived, so it now retains none.max_thread_pool_free_size(default 1000). Idle counts in stateless runs peak at ~400-500, so the pool never shrank and every concurrency burst permanently ratcheted up the thread count and resident stack memory. Sanitizer test configs now set the threshold to 128.Verified locally: after running the
03394_distributed_*worker-path tests,StatelessWorkerThreadsandExchangeServerThreadsdrain to 0 instead of parking at their high-water marks.🤖 Generated with Claude Code
Version info
26.6.1.607