Skip to content

Commit

Permalink
Merge pull request #29494 from ClickHouse/fix-possible-pushing-execut…
Browse files Browse the repository at this point in the history
…or-hang

Fix possible hang in PushingAsyncPipelineExecutor.
  • Loading branch information
KochetovNicolai committed Sep 29, 2021
2 parents 1a0feaa + ee2c12b commit 8d85590
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Processors/Executors/PushingAsyncPipelineExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class PushingAsyncSource : public ISource

void finish()
{
std::unique_lock lock(mutex);
is_finished = true;
condvar.notify_all();
}
Expand All @@ -64,7 +65,7 @@ class PushingAsyncSource : public ISource
private:
Chunk data;
bool has_data = false;
std::atomic_bool is_finished = false;
bool is_finished = false;
std::mutex mutex;
std::condition_variable condvar;
};
Expand Down

0 comments on commit 8d85590

Please sign in to comment.