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

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


The following commit(s) were added to refs/heads/master by this push:
     new 896a08c  [Enhancement] add thread id in be log (#6891)
896a08c is described below

commit 896a08cbcfcca8fa4c86055110252432ff90a305
Author: Xiang Wei <[email protected]>
AuthorDate: Sun Nov 14 18:52:01 2021 +0800

    [Enhancement] add thread id in be log (#6891)
    
    Add thread id in be log in order to quickly find the query id that caused 
the BE crushed by segmentation fault
    See #6890
---
 be/src/runtime/fragment_mgr.cpp           | 3 +++
 be/src/runtime/plan_fragment_executor.cpp | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp
index 5cd403d..4178e21 100644
--- a/be/src/runtime/fragment_mgr.cpp
+++ b/be/src/runtime/fragment_mgr.cpp
@@ -452,6 +452,9 @@ FragmentMgr::~FragmentMgr() {
 static void empty_function(PlanFragmentExecutor* exec) {}
 
 void FragmentMgr::_exec_actual(std::shared_ptr<FragmentExecState> exec_state, 
FinishCallback cb) {
+    TAG(LOG(INFO)).log("PlanFragmentExecutor::_exec_actual")
+            
.query_id(exec_state->query_id()).instance_id(exec_state->fragment_instance_id())
+            .tag("pthread_id", std::to_string((uintptr_t) pthread_self()));
     exec_state->execute();
 
     std::shared_ptr<QueryFragmentsCtx> fragments_ctx = 
exec_state->get_fragments_ctx();
diff --git a/be/src/runtime/plan_fragment_executor.cpp 
b/be/src/runtime/plan_fragment_executor.cpp
index 670248e..ecb3f43 100644
--- a/be/src/runtime/plan_fragment_executor.cpp
+++ b/be/src/runtime/plan_fragment_executor.cpp
@@ -39,6 +39,7 @@
 #include "util/mem_info.h"
 #include "util/parse_util.h"
 #include "util/pretty_printer.h"
+#include "util/uid_util.h"
 #include "util/logging.h"
 
 namespace doris {
@@ -71,7 +72,8 @@ Status PlanFragmentExecutor::prepare(const 
TExecPlanFragmentParams& request,
 
     TAG(LOG(INFO)).log("PlanFragmentExecutor::prepare")
                   .query_id(_query_id).instance_id(params.fragment_instance_id)
-                  .tag("backend_num", std::to_string(request.backend_num));
+                  .tag("backend_num", std::to_string(request.backend_num))
+                  .tag("pthread_id", std::to_string((uintptr_t) 
pthread_self()));
     // VLOG_CRITICAL << "request:\n" << 
apache::thrift::ThriftDebugString(request);
 
     const TQueryGlobals& query_globals =

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

Reply via email to