yiguolei commented on code in PR #46366: URL: https://github.com/apache/doris/pull/46366#discussion_r1901534752
########## be/src/util/threadpool.cpp: ########## @@ -273,19 +273,30 @@ ThreadPool::~ThreadPool() { shutdown(); } -Status ThreadPool::init() { - if (!_pool_status.is<UNINITIALIZED>()) { - return Status::NotSupported("The thread pool {} is already initialized", _name); - } - _pool_status = Status::OK(); - _num_threads_pending_start = _min_threads; - for (int i = 0; i < _min_threads; i++) { +Status ThreadPool::try_create_thread(int thread_num) { + _num_threads_pending_start += thread_num; + for (int i = 0; i < thread_num; i++) { Status status = create_thread(); if (!status.ok()) { - shutdown(); + _num_threads_pending_start--; + LOG(WARNING) << "Thread pool " << _name + << " failed to create thread: " << status.to_string(); Review Comment: 这里不需要 写to_string, status 重写了operator << ,会自动to string的 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org