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

dataroaring pushed a commit to branch branch-4.0-preview
in repository https://gitbox.apache.org/repos/asf/doris.git

commit fa537134e74b8e5b74ca9a9d163ae8285f108ea0
Author: Jerry Hu <[email protected]>
AuthorDate: Mon Apr 22 12:00:43 2024 +0800

    [fix](pipeline_x) The execution loop of a task should be broken if the task 
is cancelled (#33938)
---
 be/src/pipeline/pipeline_x/pipeline_x_task.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/be/src/pipeline/pipeline_x/pipeline_x_task.cpp 
b/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
index d08b05f3c45..69ff1b40257 100644
--- a/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
+++ b/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
@@ -258,6 +258,14 @@ Status PipelineXTask::execute(bool* eos) {
             set_state(PipelineTaskState::BLOCKED_FOR_SINK);
             break;
         }
+
+        /// When a task is cancelled,
+        /// its blocking state will be cleared and it will transition to a 
ready state (though it is not truly ready).
+        /// Here, checking whether it is cancelled to prevent tasks in a 
blocking state from being re-executed.
+        if (_fragment_context->is_canceled()) {
+            break;
+        }
+
         if (time_spent > THREAD_TIME_SLICE) {
             COUNTER_UPDATE(_yield_counts, 1);
             break;


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

Reply via email to