mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 18:02:24 +00:00
Revert "Revert "Revert "make d-tor Finalizer more obvious"""
This commit is contained in:
parent
02f27e53f7
commit
3034a97631
@ -1,4 +1,3 @@
|
||||
#include <exception>
|
||||
#include <Storages/MergeTree/MergeTreeSink.h>
|
||||
#include <Storages/StorageMergeTree.h>
|
||||
#include <Interpreters/PartLog.h>
|
||||
@ -45,8 +44,6 @@ MergeTreeSink::~MergeTreeSink()
|
||||
if (!delayed_chunk)
|
||||
return;
|
||||
|
||||
chassert(isCancelled() || std::uncaught_exceptions());
|
||||
|
||||
for (auto & partition : delayed_chunk->partitions)
|
||||
{
|
||||
partition.temp_part.cancel();
|
||||
|
@ -119,7 +119,7 @@ struct MergedBlockOutputStream::Finalizer::Impl
|
||||
}
|
||||
|
||||
void finish();
|
||||
void cancel() noexcept;
|
||||
void cancel();
|
||||
};
|
||||
|
||||
void MergedBlockOutputStream::Finalizer::finish()
|
||||
@ -130,7 +130,7 @@ void MergedBlockOutputStream::Finalizer::finish()
|
||||
to_finish->finish();
|
||||
}
|
||||
|
||||
void MergedBlockOutputStream::Finalizer::cancel() noexcept
|
||||
void MergedBlockOutputStream::Finalizer::cancel()
|
||||
{
|
||||
std::unique_ptr<Impl> to_cancel = std::move(impl);
|
||||
impl.reset();
|
||||
@ -167,7 +167,7 @@ void MergedBlockOutputStream::Finalizer::Impl::finish()
|
||||
part->getDataPartStorage().removeFile(file_name);
|
||||
}
|
||||
|
||||
void MergedBlockOutputStream::Finalizer::Impl::cancel() noexcept
|
||||
void MergedBlockOutputStream::Finalizer::Impl::cancel()
|
||||
{
|
||||
writer.cancel();
|
||||
|
||||
@ -183,8 +183,15 @@ MergedBlockOutputStream::Finalizer::Finalizer(std::unique_ptr<Impl> impl_) : imp
|
||||
|
||||
MergedBlockOutputStream::Finalizer::~Finalizer()
|
||||
{
|
||||
if (impl)
|
||||
cancel();
|
||||
try
|
||||
{
|
||||
if (impl)
|
||||
finish();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
~Finalizer();
|
||||
|
||||
void finish();
|
||||
void cancel() noexcept;
|
||||
void cancel();
|
||||
};
|
||||
|
||||
/// Finalize writing part and fill inner structures
|
||||
|
@ -179,8 +179,6 @@ ReplicatedMergeTreeSinkImpl<async_insert>::~ReplicatedMergeTreeSinkImpl()
|
||||
if (!delayed_chunk)
|
||||
return;
|
||||
|
||||
chassert(isCancelled() || std::uncaught_exceptions());
|
||||
|
||||
for (auto & partition : delayed_chunk->partitions)
|
||||
{
|
||||
partition.temp_part.cancel();
|
||||
|
Loading…
Reference in New Issue
Block a user