This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-2.0-alpha
in repository https://gitbox.apache.org/repos/asf/doris.git

commit e4d11ca3ad74dc49abaf57699cda9d8e9ddc412a
Author: wangbo <[email protected]>
AuthorDate: Sun Apr 16 18:17:18 2023 +0800

    [fix](executor)Fix scanner's _max_thread_num may == 0 #18465
---
 be/src/vec/exec/scan/scanner_context.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/be/src/vec/exec/scan/scanner_context.cpp 
b/be/src/vec/exec/scan/scanner_context.cpp
index a42044f4c1..1c1cd3f73f 100644
--- a/be/src/vec/exec/scan/scanner_context.cpp
+++ b/be/src/vec/exec/scan/scanner_context.cpp
@@ -57,6 +57,8 @@ Status ScannerContext::init() {
     // should find a more reasonable value.
     _max_thread_num = _state->shared_scan_opt() ? 
config::doris_scanner_thread_pool_thread_num
                                                 : 
config::doris_scanner_thread_pool_thread_num / 4;
+    _max_thread_num = _max_thread_num == 0 ? 1 : _max_thread_num;
+    DCHECK(_max_thread_num > 0);
     _max_thread_num = std::min(_max_thread_num, (int32_t)_scanners.size());
     // For select * from table limit 10; should just use one thread.
     if (_parent->should_run_serial()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to