From a05813267c12c2ab7f74514a9bdabd4ef698f091 Mon Sep 17 00:00:00 2001 From: Xinyi Zou Date: Wed, 17 Apr 2024 00:38:18 +0800 Subject: [PATCH] 2 --- be/src/runtime/fragment_mgr.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp index 13a544d9220120..03d6525154db81 100644 --- a/be/src/runtime/fragment_mgr.cpp +++ b/be/src/runtime/fragment_mgr.cpp @@ -901,7 +901,6 @@ Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, return Status::OK(); } else { auto pre_and_submit = [&](int i) { - SCOPED_ATTACH_TASK_WITH_ID(query_ctx->query_mem_tracker, params.query_id); const auto& local_params = params.local_params[i]; const TUniqueId& fragment_instance_id = local_params.fragment_instance_id; @@ -984,7 +983,10 @@ Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, for (size_t i = 0; i < target_size; i++) { RETURN_IF_ERROR(_thread_pool->submit_func([&, i]() { - prepare_status[i] = pre_and_submit(i); + { + SCOPED_ATTACH_TASK_WITH_ID(query_ctx->query_mem_tracker, params.query_id); + prepare_status[i] = pre_and_submit(i); + } std::unique_lock lock(m); prepare_done++; if (prepare_done == target_size) {