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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3f98b1f4ce7 [pipelineX](fix) Fix coredump by incorrect cancel order 
(#33294)
3f98b1f4ce7 is described below

commit 3f98b1f4ce74bf1152631597972a58252e11ffc1
Author: Gabriel <gabrielleeb...@gmail.com>
AuthorDate: Sun Apr 7 12:05:22 2024 +0800

    [pipelineX](fix) Fix coredump by incorrect cancel order (#33294)
---
 be/src/runtime/query_context.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/be/src/runtime/query_context.cpp b/be/src/runtime/query_context.cpp
index 2007b576857..c210449aa8e 100644
--- a/be/src/runtime/query_context.cpp
+++ b/be/src/runtime/query_context.cpp
@@ -171,13 +171,14 @@ void QueryContext::set_execution_dependency_ready() {
 }
 
 void QueryContext::cancel(std::string msg, Status new_status, int fragment_id) 
{
+    // we must get this wrong status once query ctx's `_is_cancelled` = true.
+    set_exec_status(new_status);
     // Just for CAS need a left value
     bool false_cancel = false;
     if (!_is_cancelled.compare_exchange_strong(false_cancel, true)) {
         return;
     }
     DCHECK(!false_cancel && _is_cancelled);
-    set_exec_status(new_status);
 
     set_ready_to_execute(true);
     std::vector<std::weak_ptr<pipeline::PipelineFragmentContext>> 
ctx_to_cancel;
@@ -197,7 +198,6 @@ void QueryContext::cancel(std::string msg, Status 
new_status, int fragment_id) {
             pipeline_ctx->cancel(PPlanFragmentCancelReason::INTERNAL_ERROR, 
msg);
         }
     }
-    return;
 }
 
 void QueryContext::cancel_all_pipeline_context(const 
PPlanFragmentCancelReason& reason,


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

Reply via email to