Skip to content

Commit e9da494

Browse files
authored
[minor](log) Add logs for WorkThreadPool (#59503)
1 parent 44736cb commit e9da494

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

be/src/util/work_thread_pool.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ class WorkThreadPool {
128128
return (Priority ? "PriorityThreadPool" : "FifoThreadPool") +
129129
fmt::format(
130130
"(name={}, queue_size={}/{}, active_thread={}/{}, "
131-
"total_get_wait_time={}, total_put_wait_time={})",
131+
"total_get_wait_time={}, total_put_wait_time={}, is_shutdown={})",
132132
_name, get_queue_size(), _work_queue.get_capacity(), _active_threads,
133133
_threads.size(), _work_queue.total_get_wait_time(),
134-
_work_queue.total_put_wait_time());
134+
_work_queue.total_put_wait_time(), is_shutdown());
135135
}
136136

137137
protected:
138-
virtual bool is_shutdown() { return _shutdown; }
138+
virtual bool is_shutdown() const { return _shutdown; }
139139

140140
// Collection of worker threads that process work from the queue.
141141
ThreadGroup _threads;
@@ -151,6 +151,7 @@ class WorkThreadPool {
151151
// until the pool is shutdown.
152152
void work_thread(int thread_id) {
153153
Thread::set_self_name(_name);
154+
LOG(INFO) << "WorkThreadPool started: " << get_info();
154155
while (!is_shutdown()) {
155156
Task task;
156157
if (_work_queue.blocking_get(&task)) {
@@ -162,6 +163,7 @@ class WorkThreadPool {
162163
_empty_cv.notify_all();
163164
}
164165
}
166+
LOG(INFO) << "WorkThreadPool shutdown: " << get_info();
165167
}
166168

167169
WorkQueue _work_queue;

0 commit comments

Comments
 (0)