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

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

commit e384b495e3b70194bdd12559bea569a797b6aa7a
Author: Jerry Hu <mrh...@gmail.com>
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 da3da7404f6..64b11ceffb1 100644
--- a/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
+++ b/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
@@ -254,6 +254,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: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to