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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new cd21350a1f2 [feature](executor)make task wait timeout config #28382
cd21350a1f2 is described below

commit cd21350a1f22bbbc22fbd880e9734825914a0c1f
Author: wangbo <wan...@apache.org>
AuthorDate: Thu Dec 14 17:23:43 2023 +0800

    [feature](executor)make task wait timeout config #28382
---
 be/src/common/config.cpp                 |  1 +
 be/src/common/config.h                   |  1 +
 be/src/vec/exec/scan/scan_task_queue.cpp | 10 +++++++---
 be/src/vec/exec/scan/scan_task_queue.h   |  1 -
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 7500e889963..dafc613d77c 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -956,6 +956,7 @@ DEFINE_Bool(enable_debug_points, "false");
 
 DEFINE_Int32(pipeline_executor_size, "0");
 DEFINE_mBool(enable_workload_group_for_scan, "false");
+DEFINE_mInt64(workload_group_scan_task_wait_timeout_ms, "10000");
 
 // Temp config. True to use optimization for bitmap_index apply predicate 
except leaf node of the and node.
 // Will remove after fully test.
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 602fdff53f0..65b9de8f12e 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -998,6 +998,7 @@ DECLARE_Bool(enable_debug_points);
 
 DECLARE_Int32(pipeline_executor_size);
 DECLARE_mBool(enable_workload_group_for_scan);
+DECLARE_mInt64(workload_group_scan_task_wait_timeout_ms);
 
 // Temp config. True to use optimization for bitmap_index apply predicate 
except leaf node of the and node.
 // Will remove after fully test.
diff --git a/be/src/vec/exec/scan/scan_task_queue.cpp 
b/be/src/vec/exec/scan/scan_task_queue.cpp
index 538f77211c3..62f548d8f17 100644
--- a/be/src/vec/exec/scan/scan_task_queue.cpp
+++ b/be/src/vec/exec/scan/scan_task_queue.cpp
@@ -67,11 +67,14 @@ bool ScanTaskTaskGroupQueue::take(ScanTask* scan_task) {
             return false;
         }
         if (_group_entities.empty()) {
-            _wait_task.wait_for(lock, 
std::chrono::milliseconds(WAIT_CORE_TASK_TIMEOUT_MS * 5));
+            _wait_task.wait_for(lock, std::chrono::milliseconds(
+                                              
config::workload_group_scan_task_wait_timeout_ms));
         } else {
             entity = _next_tg_entity();
             if (!entity) {
-                _wait_task.wait_for(lock, 
std::chrono::milliseconds(WAIT_CORE_TASK_TIMEOUT_MS));
+                _wait_task.wait_for(lock,
+                                    std::chrono::milliseconds(
+                                            
config::workload_group_scan_task_wait_timeout_ms));
             }
         }
     }
@@ -79,7 +82,8 @@ bool ScanTaskTaskGroupQueue::take(ScanTask* scan_task) {
     if (entity->task_size() == 1) {
         _dequeue_task_group(entity);
     }
-    return entity->task_queue()->try_get(scan_task, WAIT_CORE_TASK_TIMEOUT_MS 
/* timeout_ms */);
+    return entity->task_queue()->try_get(
+            scan_task, config::workload_group_scan_task_wait_timeout_ms /* 
timeout_ms */);
 }
 
 bool ScanTaskTaskGroupQueue::push_back(ScanTask scan_task) {
diff --git a/be/src/vec/exec/scan/scan_task_queue.h 
b/be/src/vec/exec/scan/scan_task_queue.h
index f3c3b792a48..5605196d532 100644
--- a/be/src/vec/exec/scan/scan_task_queue.h
+++ b/be/src/vec/exec/scan/scan_task_queue.h
@@ -28,7 +28,6 @@ class ScannerContext;
 namespace taskgroup {
 
 using WorkFunction = std::function<void()>;
-static constexpr auto WAIT_CORE_TASK_TIMEOUT_MS = 100;
 
 // Like PriorityThreadPool::Task
 struct ScanTask {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to