From 12b643a596f317400fab7942bd692377ab0c73a0 Mon Sep 17 00:00:00 2001 From: Pxl Date: Fri, 24 May 2024 15:32:42 +0800 Subject: [PATCH 1/2] [Chore](pipeline) set PipelineFragmentContext::_timeout and adjust dump_pipeline_tasks infomation display (#35328) set PipelineFragmentContext::_timeout and adjust dump_pipeline_tasks infomation display --- be/src/pipeline/pipeline_fragment_context.h | 2 ++ be/src/runtime/fragment_mgr.cpp | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/be/src/pipeline/pipeline_fragment_context.h b/be/src/pipeline/pipeline_fragment_context.h index 770b64d0dc0a66..aaf48a9d06defb 100644 --- a/be/src/pipeline/pipeline_fragment_context.h +++ b/be/src/pipeline/pipeline_fragment_context.h @@ -71,6 +71,8 @@ class PipelineFragmentContext : public TaskExecutionContext { bool is_timeout(const VecDateTimeValue& now) const; + int timeout_second() const { return _timeout; } + PipelinePtr add_pipeline(); PipelinePtr add_pipeline(PipelinePtr parent, int idx = -1); diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp index ade9a885aae521..37a1931b45cdf4 100644 --- a/be/src/runtime/fragment_mgr.cpp +++ b/be/src/runtime/fragment_mgr.cpp @@ -797,16 +797,24 @@ std::string FragmentMgr::dump_pipeline_tasks(int64_t duration) { size_t i = 0; { std::lock_guard lock(_lock); - fmt::format_to(debug_string_buffer, "{} pipeline fragment contexts are still running!\n", - _pipeline_map.size()); + fmt::format_to(debug_string_buffer, + "{} pipeline fragment contexts are still running! duration_limit={}\n", + _pipeline_map.size(), duration); + + timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); for (auto& it : _pipeline_map) { auto elapsed = (t - it.second->create_time()) / 1000000000.0; if (elapsed < duration) { // Only display tasks which has been running for more than {duration} seconds. continue; } - fmt::format_to(debug_string_buffer, "No.{} (elapse time = {}s, InstanceId = {}) : {}\n", - i, elapsed, print_id(it.first), it.second->debug_string()); + auto timeout_second = it.second->timeout_second(); + fmt::format_to(debug_string_buffer, + "No.{} (elapse_second={}s, query_timeout_second={}s, instance_id=" + "{}, is_timeout={}) : {}\n", + i, elapsed, timeout_second, print_id(it.first), + it.second->is_timeout(now), it.second->debug_string()); i++; } } From d64c957d4fc24915ea8b4f10e5627c031a609921 Mon Sep 17 00:00:00 2001 From: BiteTheDDDDt Date: Fri, 7 Jun 2024 11:54:15 +0800 Subject: [PATCH 2/2] fix --- be/src/runtime/fragment_mgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp index 37a1931b45cdf4..6646b8cdf274f5 100644 --- a/be/src/runtime/fragment_mgr.cpp +++ b/be/src/runtime/fragment_mgr.cpp @@ -812,9 +812,9 @@ std::string FragmentMgr::dump_pipeline_tasks(int64_t duration) { auto timeout_second = it.second->timeout_second(); fmt::format_to(debug_string_buffer, "No.{} (elapse_second={}s, query_timeout_second={}s, instance_id=" - "{}, is_timeout={}) : {}\n", + "{}) : {}\n", i, elapsed, timeout_second, print_id(it.first), - it.second->is_timeout(now), it.second->debug_string()); + it.second->debug_string()); i++; } }