You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/12/19 05:10:53 UTC

[doris] 19/21: [enhancement](signal) output query_id when 'be' core dumped #15080

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

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit d79b6017963ac1907a61bc13e955fe097d7b52b3
Author: Tiewei Fang <43...@users.noreply.github.com>
AuthorDate: Mon Dec 19 09:47:38 2022 +0800

    [enhancement](signal) output query_id when 'be' core dumped #15080
---
 be/src/runtime/fragment_mgr.cpp   | 5 -----
 be/src/runtime/thread_context.cpp | 3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp
index b4e0595451..9bf0a361cd 100644
--- a/be/src/runtime/fragment_mgr.cpp
+++ b/be/src/runtime/fragment_mgr.cpp
@@ -26,7 +26,6 @@
 
 #include "agent/cgroups_mgr.h"
 #include "common/object_pool.h"
-#include "common/signal_handler.h"
 #include "gen_cpp/FrontendService.h"
 #include "gen_cpp/PaloInternalService_types.h"
 #include "gen_cpp/PlanNodes_types.h"
@@ -486,10 +485,6 @@ void FragmentMgr::_exec_actual(std::shared_ptr<FragmentExecState> exec_state, Fi
     span->SetAttribute("query_id", print_id(exec_state->query_id()));
     span->SetAttribute("instance_id", print_id(exec_state->fragment_instance_id()));
 
-    // these two are used to output query_id when be cored dump.
-    doris::signal::query_id_hi = exec_state->query_id().hi;
-    doris::signal::query_id_lo = exec_state->query_id().lo;
-
     LOG_INFO(func_name)
             .tag("query_id", exec_state->query_id())
             .tag("instance_id", exec_state->fragment_instance_id())
diff --git a/be/src/runtime/thread_context.cpp b/be/src/runtime/thread_context.cpp
index 6caafdc5db..d30d836064 100644
--- a/be/src/runtime/thread_context.cpp
+++ b/be/src/runtime/thread_context.cpp
@@ -17,6 +17,7 @@
 
 #include "runtime/thread_context.h"
 
+#include "common/signal_handler.h"
 #include "runtime/runtime_state.h"
 #include "util/doris_metrics.h"
 
@@ -44,6 +45,8 @@ AttachTask::AttachTask(const std::shared_ptr<MemTrackerLimiter>& mem_tracker,
 }
 
 AttachTask::AttachTask(RuntimeState* runtime_state) {
+    doris::signal::query_id_hi = runtime_state->query_id().hi;
+    doris::signal::query_id_lo = runtime_state->query_id().lo;
     thread_context()->attach_task(print_id(runtime_state->query_id()),
                                   runtime_state->fragment_instance_id(),
                                   runtime_state->query_mem_tracker());


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