Fix sinks with onException() handler

It is possible to call onException() even after onFinish(), in case of
onFinish() throws, and in this case onException() should be no-op for
such sinks.

Also there can be caveats with PartitionedSync.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-06-01 17:59:58 +03:00
parent 02af58f41d
commit 545a56ce45
4 changed files with 8 additions and 0 deletions

View File

@ -418,6 +418,8 @@ public:
void onException() override
{
if (!writer)
return;
onFinish();
}

View File

@ -812,6 +812,8 @@ public:
void onException() override
{
if (!writer)
return;
onFinish();
}

View File

@ -603,6 +603,8 @@ public:
void onException() override
{
if (!writer)
return;
onFinish();
}

View File

@ -445,6 +445,8 @@ void StorageURLSink::consume(Chunk chunk)
void StorageURLSink::onException()
{
if (!writer)
return;
onFinish();
}