Merge pull request #45481 from ClickHouse/fix-deadlock-with-allow_asynchronous_read_from_io_pool_for_merge_tree

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-21 12:05:34 +01:00 committed by GitHub
commit b877c484d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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()