Fix tests.

This commit is contained in:
Nikolai Kochetov 2021-02-25 00:31:15 +03:00
parent aa8632a1bc
commit 6f5d4ba8cd

View File

@ -171,14 +171,14 @@ bool PullingAsyncPipelineExecutor::pull(Block & block, uint64_t milliseconds)
void PullingAsyncPipelineExecutor::cancel()
{
/// Finish lazy format. Otherwise thread.join() may hung.
if (lazy_format && !lazy_format->isFinished())
lazy_format->finish();
/// Cancel execution if it wasn't finished.
if (data && !data->is_finished && data->executor)
data->executor->cancel();
/// Finish lazy format. Otherwise thread.join() may hung.
if (lazy_format && !lazy_format->isFinished())
lazy_format->finish();
/// Join thread here to wait for possible exception.
if (data && data->thread.joinable())
data->thread.join();