github-actions[bot] commented on code in PR #31106: URL: https://github.com/apache/doris/pull/31106#discussion_r1494467939
########## be/src/vec/exec/scan/scanner_scheduler.h: ########## @@ -128,27 +124,32 @@ class SimplifiedScanScheduler { .set_max_threads(config::doris_scanner_thread_pool_thread_num) .set_cgroup_cpu_ctl(_cgroup_cpu_ctl) .build(&_scan_thread_pool)); - - for (int i = 0; i < config::doris_scanner_thread_pool_thread_num; i++) { - RETURN_IF_ERROR(_scan_thread_pool->submit_func([this] { this->_work(); })); - } return Status::OK(); } - BlockingQueue<SimplifiedScanTask>* get_scan_queue() { return _scan_task_queue.get(); } + Status submit_scan_task(SimplifiedScanTask scan_task) { + if (!_is_stop) { + return _scan_thread_pool->submit_func([scan_task] { scan_task.scan_func(); }); + } else { + return Status::InternalError<false>("scanner pool {} is shutdown.", _wg_name); + } + } -private: - void _work() { - while (!_is_stop.load()) { - SimplifiedScanTask scan_task; - if (_scan_task_queue->blocking_get(&scan_task)) { - scan_task.scan_func(); - }; + void reset_thread_num(int thread_num) { Review Comment: warning: method 'reset_thread_num' can be made static [readability-convert-member-functions-to-static] ```suggestion static void reset_thread_num(int thread_num) { ``` -- 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