From c58643e04baa4540e05a86f6857c46f6e96646c1 Mon Sep 17 00:00:00 2001 From: Yarik Briukhovetskyi <114298166+yariks5s@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:19:41 +0100 Subject: [PATCH] Revert some changes. --- src/Interpreters/ProcessList.cpp | 3 ++- src/Processors/Executors/PipelineExecutor.cpp | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Interpreters/ProcessList.cpp b/src/Interpreters/ProcessList.cpp index 898856c4f8b..3c04e3d6bba 100644 --- a/src/Interpreters/ProcessList.cpp +++ b/src/Interpreters/ProcessList.cpp @@ -504,11 +504,12 @@ void QueryStatus::throwProperExceptionIfNeeded(const UInt64 & max_execution_time } } -void QueryStatus::addPipelineExecutor(PipelineExecutor * e, UInt64 max_exec_time) +void QueryStatus::addPipelineExecutor(PipelineExecutor * e) { /// In case of asynchronous distributed queries it is possible to call /// addPipelineExecutor() from the cancelQuery() context, and this will /// lead to deadlock. + UInt64 max_exec_time = getContext()->getSettingsRef()[Setting::max_execution_time].totalMilliseconds(); throwProperExceptionIfNeeded(max_exec_time); std::lock_guard lock(executors_mutex); diff --git a/src/Processors/Executors/PipelineExecutor.cpp b/src/Processors/Executors/PipelineExecutor.cpp index 7fbcc3c9d3f..94804822d1f 100644 --- a/src/Processors/Executors/PipelineExecutor.cpp +++ b/src/Processors/Executors/PipelineExecutor.cpp @@ -68,8 +68,7 @@ PipelineExecutor::PipelineExecutor(std::shared_ptr & processors, Que { // Add the pipeline to the QueryStatus at the end to avoid issues if other things throw // as that would leave the executor "linked" - UInt64 max_exec_time = process_list_element->getContext()->getSettingsRef()[Setting::max_execution_time].totalMilliseconds(); - process_list_element->addPipelineExecutor(this, max_exec_time); + process_list_element->addPipelineExecutor(this); } }