Fix possible deadlock with allow_asynchronous_read_from_io_pool_for_merge_tree in case of exception from ThreadPool::schedule

This commit is contained in:
Nikolai Kochetov 2023-01-20 18:57:47 +00:00
parent c7d12564cb
commit dcd84c152a

View File

@ -104,7 +104,16 @@ struct MergeTreeSource::AsyncReadingState
void schedule(ThreadPool::Job job)
{
callback_runner(std::move(job), 0);
try
{
callback_runner(std::move(job), 0);
}
catch (...)
{
/// Roll back stage in case of exception from ThreadPool::schedule
control->stage = Stage::NotStarted;
throw;
}
}
ChunkAndProgress getResult()