mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix 'Empty task was returned from async task queue' on query cancellation
This commit is contained in:
parent
45119fce4f
commit
9c01869090
@ -540,7 +540,12 @@ void PipelineExecutor::executeStepImpl(size_t thread_num, size_t num_threads, st
|
|||||||
/// If we execute in single thread, wait for async tasks here.
|
/// If we execute in single thread, wait for async tasks here.
|
||||||
auto res = async_task_queue.wait(lock);
|
auto res = async_task_queue.wait(lock);
|
||||||
if (!res)
|
if (!res)
|
||||||
|
{
|
||||||
|
/// The query had been cancelled (finished is also set)
|
||||||
|
if (finished)
|
||||||
|
break;
|
||||||
throw Exception("Empty task was returned from async task queue", ErrorCodes::LOGICAL_ERROR);
|
throw Exception("Empty task was returned from async task queue", ErrorCodes::LOGICAL_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
node = static_cast<ExecutingGraph::Node *>(res.data);
|
node = static_cast<ExecutingGraph::Node *>(res.data);
|
||||||
break;
|
break;
|
||||||
|
12
tests/queries/0_stateless/01731_async_task_queue_wait.sh
Executable file
12
tests/queries/0_stateless/01731_async_task_queue_wait.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CURDIR"/../shell_config.sh
|
||||||
|
|
||||||
|
# regression for 'Empty task was returned from async task queue' during query
|
||||||
|
# cancellation with async_socket_for_remote=1 (that ignores
|
||||||
|
# max_distributed_connections)
|
||||||
|
timeout 5s ${CLICKHOUSE_CLIENT} --max_distributed_connections=1 --format Null -q "select * from remote('127.{2..11}', view(select * from numbers(1e9))) group by number format Null"
|
||||||
|
# timedout
|
||||||
|
test $? -eq 124
|
Loading…
Reference in New Issue
Block a user