From 147c55a2afaf96ea90c2d67ef1dab435d0b433bb Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 31 Dec 2025 10:55:17 +0800 Subject: [PATCH 1/2] [minor](log) Add logs for WorkThreadPool --- be/src/util/work_thread_pool.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/be/src/util/work_thread_pool.hpp b/be/src/util/work_thread_pool.hpp index 1da8a08f90d234..a0ab049bcf6291 100644 --- a/be/src/util/work_thread_pool.hpp +++ b/be/src/util/work_thread_pool.hpp @@ -128,10 +128,10 @@ class WorkThreadPool { return (Priority ? "PriorityThreadPool" : "FifoThreadPool") + fmt::format( "(name={}, queue_size={}/{}, active_thread={}/{}, " - "total_get_wait_time={}, total_put_wait_time={})", + "total_get_wait_time={}, total_put_wait_time={}, is_shutdown={})", _name, get_queue_size(), _work_queue.get_capacity(), _active_threads, _threads.size(), _work_queue.total_get_wait_time(), - _work_queue.total_put_wait_time()); + _work_queue.total_put_wait_time(), is_shutdown()); } protected: @@ -151,6 +151,7 @@ class WorkThreadPool { // until the pool is shutdown. void work_thread(int thread_id) { Thread::set_self_name(_name); + LOG(INFO) << "WorkThreadPool started: " << get_info(); while (!is_shutdown()) { Task task; if (_work_queue.blocking_get(&task)) { @@ -162,6 +163,7 @@ class WorkThreadPool { _empty_cv.notify_all(); } } + LOG(INFO) << "WorkThreadPool shutdown: " << get_info(); } WorkQueue _work_queue; From b8e41f4765764772531c2d57c8a917b4fe5ab87d Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 31 Dec 2025 11:21:45 +0800 Subject: [PATCH 2/2] update --- be/src/util/work_thread_pool.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/util/work_thread_pool.hpp b/be/src/util/work_thread_pool.hpp index a0ab049bcf6291..27b7e3d6bb6dc8 100644 --- a/be/src/util/work_thread_pool.hpp +++ b/be/src/util/work_thread_pool.hpp @@ -135,7 +135,7 @@ class WorkThreadPool { } protected: - virtual bool is_shutdown() { return _shutdown; } + virtual bool is_shutdown() const { return _shutdown; } // Collection of worker threads that process work from the queue. ThreadGroup _threads;