#34364·yugabyte-db

[DocDB] Use default_idle_timeout_ms for ThreadPoolBuilder thread pools

Author: spolitovCreated Sep 29, 2026Updated Sep 29, 2026
Labelskind/enhancementarea/docdbpriority/mediumstatus/awaiting-triage

Jira Link: DB-23906

Description

Since ThreadPoolBuilder became a wrapper over YBThreadPool, the pools built through it (prepare, consensus, log-sync, log-alloc, apply, append, the master sys catalog pools, etc.) still use the builder's hardcoded 500 ms idle timeout. YBThreadPool parks idle workers on a LIFO stack and starts a new thread before queueing a task, so under bursty load a few hot workers do all the work while the rest sit idle past 500 ms, exit, and get recreated on the next spike. On a saturated CPU each recreation stalls on the run queue, producing thousands of Time spent starting thread warnings per node from the prepare and consensus pools.

default_idle_timeout_ms only reaches pools built directly as YBThreadPool (the RPC pools), so there is no way to tune these pools without a code change.

Make ThreadPoolBuilder default to default_idle_timeout_ms (15 s) instead of the hardcoded 500 ms, so all thread pools share the same idle timeout and it can be tuned with one flag.

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.