Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions be/src/util/work_thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ 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:
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;
Expand All @@ -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)) {
Expand All @@ -162,6 +163,7 @@ class WorkThreadPool {
_empty_cv.notify_all();
}
}
LOG(INFO) << "WorkThreadPool shutdown: " << get_info();
}

WorkQueue _work_queue;
Expand Down
Loading