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 b155fc07f6 [fix](fragment thread) fix thread in fragment thread pool 
hang (#16608)
b155fc07f6 is described below

commit b155fc07f6dedac1b35cec14c605594d7eb2d01e
Author: YueW <[email protected]>
AuthorDate: Sat Feb 11 09:05:10 2023 +0800

    [fix](fragment thread) fix thread in fragment thread pool hang (#16608)
    
    process the return status for exec_state->execute() in function 
FragmentMgr::_exec_actual
---
 be/src/runtime/fragment_mgr.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp
index d705ff1141..654c252d58 100644
--- a/be/src/runtime/fragment_mgr.cpp
+++ b/be/src/runtime/fragment_mgr.cpp
@@ -226,10 +226,13 @@ Status FragmentExecState::execute() {
         SCOPED_RAW_TIMER(&duration_ns);
         CgroupsMgr::apply_system_cgroup();
         opentelemetry::trace::Tracer::GetCurrentSpan()->AddEvent("start 
executing Fragment");
-        WARN_IF_ERROR(_executor.open(),
+        Status st = _executor.open();
+        WARN_IF_ERROR(st,
                       strings::Substitute("Got error while opening fragment 
$0, query id: $1",
                                           print_id(_fragment_instance_id), 
print_id(_query_id)));
-
+        if (!st.ok()) {
+            cancel(PPlanFragmentCancelReason::INTERNAL_ERROR, 
"PlanFragmentExecutor open failed");
+        }
         _executor.close();
     }
     DorisMetrics::instance()->fragment_requests_total->increment(1);
@@ -464,7 +467,10 @@ void 
FragmentMgr::_exec_actual(std::shared_ptr<FragmentExecState> exec_state, Fi
             .tag("instance_id", exec_state->fragment_instance_id())
             .tag("pthread_id", (uintptr_t)pthread_self());
 
-    exec_state->execute();
+    Status st = exec_state->execute();
+    if (!st.ok()) {
+        exec_state->cancel(PPlanFragmentCancelReason::INTERNAL_ERROR, 
"exec_state execute failed");
+    }
 
     std::shared_ptr<QueryFragmentsCtx> fragments_ctx = 
exec_state->get_fragments_ctx();
     bool all_done = false;


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

Reply via email to