mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 02:52:13 +00:00
Flush LazyOutputFormat on query cancel.
This commit is contained in:
parent
6d348f2b18
commit
a5ed26c393
@ -174,9 +174,8 @@ void PullingAsyncPipelineExecutor::cancel()
|
|||||||
if (data && !data->is_finished && data->executor)
|
if (data && !data->is_finished && data->executor)
|
||||||
data->executor->cancel();
|
data->executor->cancel();
|
||||||
|
|
||||||
/// Finish lazy format. Otherwise thread.join() may hung.
|
/// The following code is needed to rethrow exception from PipelineExecutor.
|
||||||
if (lazy_format && !lazy_format->isFinished())
|
/// It could have been thrown from pull(), but we will not likely call it again.
|
||||||
lazy_format->finish();
|
|
||||||
|
|
||||||
/// Join thread here to wait for possible exception.
|
/// Join thread here to wait for possible exception.
|
||||||
if (data && data->thread.joinable())
|
if (data && data->thread.joinable())
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
|
|
||||||
void setRowsBeforeLimit(size_t rows_before_limit) override;
|
void setRowsBeforeLimit(size_t rows_before_limit) override;
|
||||||
|
|
||||||
void finish()
|
void onCancel() override
|
||||||
{
|
{
|
||||||
finished_processing = true;
|
finished_processing = true;
|
||||||
/// Clear queue in case if somebody is waiting lazy_format to push.
|
/// Clear queue in case if somebody is waiting lazy_format to push.
|
||||||
|
Loading…
Reference in New Issue
Block a user