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); } }