From 3c0451981bf492eecd60bf1bd10dc0d8c160d270 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Wed, 20 Oct 2021 13:46:42 +0300 Subject: [PATCH] Fix test. --- src/Processors/Executors/ExecutorTasks.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Processors/Executors/ExecutorTasks.cpp b/src/Processors/Executors/ExecutorTasks.cpp index 137d4a628f7..bbb08d33266 100644 --- a/src/Processors/Executors/ExecutorTasks.cpp +++ b/src/Processors/Executors/ExecutorTasks.cpp @@ -89,7 +89,11 @@ void ExecutorTasks::tryGetTask(ExecutionThreadContext & context) /// If we execute in single thread, wait for async tasks here. auto res = async_task_queue.wait(lock); if (!res) + { + if (finished) + return; throw Exception("Empty task was returned from async task queue", ErrorCodes::LOGICAL_ERROR); + } context.setTask(static_cast(res.data)); return;