Skip to content

Commit

Permalink
Fix possible deadlock with allow_asynchronous_read_from_io_pool_for_m…
Browse files Browse the repository at this point in the history
…erge_tree in case of exception from ThreadPool::schedule
  • Loading branch information
KochetovNicolai committed Jan 20, 2023
1 parent c7d1256 commit dcd84c1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Storages/MergeTree/MergeTreeSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dcd84c1

Please sign in to comment.