only set max_free_threads_ = 0 when creating pool

Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
This commit is contained in:
Duc Canh Le 2024-09-10 05:51:48 +00:00
parent 11478b949f
commit d089a56272
2 changed files with 2 additions and 4 deletions

View File

@ -82,13 +82,12 @@ ConcurrentHashJoin::ConcurrentHashJoin(
: context(context_)
, table_join(table_join_)
, slots(toPowerOfTwo(std::min<UInt32>(static_cast<UInt32>(slots_), 256)))
, max_threads(context->getSettingsRef().max_threads > 0 ? std::min(slots, context->getSettingsRef().max_threads.value) : slots)
, pool(std::make_unique<ThreadPool>(
CurrentMetrics::ConcurrentHashJoinPoolThreads,
CurrentMetrics::ConcurrentHashJoinPoolThreadsActive,
CurrentMetrics::ConcurrentHashJoinPoolThreadsScheduled,
/*max_threads_*/ max_threads,
/*max_free_threads_*/ max_threads,
/*max_threads_*/ slots,
/*max_free_threads_*/ 0,
/*queue_size_*/ slots))
, stats_collecting_params(stats_collecting_params_)
{

View File

@ -70,7 +70,6 @@ private:
ContextPtr context;
std::shared_ptr<TableJoin> table_join;
size_t slots;
size_t max_threads;
std::unique_ptr<ThreadPool> pool;
std::vector<std::shared_ptr<InternalHashJoin>> hash_joins;