turn off some d-tor finalize

This commit is contained in:
Sema Checherinda 2023-05-26 22:18:55 +02:00
parent 100b4d0969
commit 0e019c8e83
26 changed files with 47 additions and 17 deletions

View File

@ -59,6 +59,7 @@ void CompressedWriteBuffer::nextImpl()
CompressedWriteBuffer::~CompressedWriteBuffer()
{
//!
finalize();
}

View File

@ -53,6 +53,7 @@ nuraft::ptr<nuraft::buffer> WriteBufferFromNuraftBuffer::getBuffer()
WriteBufferFromNuraftBuffer::~WriteBufferFromNuraftBuffer()
{
//!
try
{
finalize();

View File

@ -123,6 +123,7 @@ void FileSegmentRangeWriter::finalize()
FileSegmentRangeWriter::~FileSegmentRangeWriter()
{
//!
try
{
if (!finalized)

View File

@ -38,6 +38,7 @@ WriteBufferFromAzureBlobStorage::WriteBufferFromAzureBlobStorage(
WriteBufferFromAzureBlobStorage::~WriteBufferFromAzureBlobStorage()
{
//!
finalize();
}

View File

@ -16,14 +16,15 @@ WriteBufferWithFinalizeCallback::WriteBufferWithFinalizeCallback(
WriteBufferWithFinalizeCallback::~WriteBufferWithFinalizeCallback()
{
try
{
finalize();
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
}
//!
// try
// {
// finalize();
// }
// catch (...)
// {
// tryLogCurrentException(__PRETTY_FUNCTION__);
// }
}
void WriteBufferWithFinalizeCallback::finalizeImpl()

View File

@ -115,6 +115,7 @@ public:
~WriteBufferFromZipArchive() override
{
//!
try
{
finalize();
@ -191,7 +192,11 @@ namespace
explicit StreamFromWriteBuffer(std::unique_ptr<WriteBuffer> write_buffer_)
: write_buffer(std::move(write_buffer_)), start_offset(write_buffer->count()) {}
~StreamFromWriteBuffer() { write_buffer->finalize(); }
~StreamFromWriteBuffer()
{
//!
write_buffer->finalize();
}
static int closeFileFunc(void *, void * stream)
{

View File

@ -44,6 +44,7 @@ BrotliWriteBuffer::BrotliWriteBuffer(std::unique_ptr<WriteBuffer> out_, int comp
BrotliWriteBuffer::~BrotliWriteBuffer()
{
//!
finalize();
}

View File

@ -47,6 +47,7 @@ Bzip2WriteBuffer::Bzip2WriteBuffer(std::unique_ptr<WriteBuffer> out_, int compre
Bzip2WriteBuffer::~Bzip2WriteBuffer()
{
//!
finalize();
}

View File

@ -53,6 +53,7 @@ void ForkWriteBuffer::finalizeImpl()
ForkWriteBuffer::~ForkWriteBuffer()
{
//!
finalize();
}

View File

@ -46,6 +46,7 @@ LZMADeflatingWriteBuffer::LZMADeflatingWriteBuffer(
LZMADeflatingWriteBuffer::~LZMADeflatingWriteBuffer()
{
//!
finalize();
}

View File

@ -42,6 +42,7 @@ Lz4DeflatingWriteBuffer::Lz4DeflatingWriteBuffer(
Lz4DeflatingWriteBuffer::~Lz4DeflatingWriteBuffer()
{
//!
finalize();
}

View File

@ -22,6 +22,7 @@ SnappyWriteBuffer::SnappyWriteBuffer(std::unique_ptr<WriteBuffer> out_, size_t b
SnappyWriteBuffer::~SnappyWriteBuffer()
{
//!
finish();
}

View File

@ -21,6 +21,7 @@ WriteBufferFromEncryptedFile::WriteBufferFromEncryptedFile(
WriteBufferFromEncryptedFile::~WriteBufferFromEncryptedFile()
{
//!
finalize();
}

View File

@ -77,6 +77,7 @@ WriteBufferFromFile::~WriteBufferFromFile()
if (fd < 0)
return;
//!
finalize();
int err = ::close(fd);
/// Everything except for EBADF should be ignored in dtor, since all of

View File

@ -30,14 +30,15 @@ void WriteBufferFromFileDecorator::finalizeImpl()
WriteBufferFromFileDecorator::~WriteBufferFromFileDecorator()
{
try
{
finalize();
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
}
//!
// try
// {
// finalize();
// }
// catch (...)
// {
// tryLogCurrentException(__PRETTY_FUNCTION__);
// }
/// It is not a mistake that swap is called here
/// Swap has been called at constructor, it should be called at destructor

View File

@ -105,6 +105,7 @@ WriteBufferFromFileDescriptor::WriteBufferFromFileDescriptor(
WriteBufferFromFileDescriptor::~WriteBufferFromFileDescriptor()
{
//!
finalize();
}

View File

@ -40,6 +40,7 @@ WriteBufferFromOStream::WriteBufferFromOStream(
WriteBufferFromOStream::~WriteBufferFromOStream()
{
//!
finalize();
}

View File

@ -106,6 +106,7 @@ WriteBufferFromPocoSocket::WriteBufferFromPocoSocket(Poco::Net::Socket & socket_
WriteBufferFromPocoSocket::~WriteBufferFromPocoSocket()
{
//!
finalize();
}

View File

@ -63,6 +63,7 @@ public:
~WriteBufferFromVector() override
{
//!
finalize();
}

View File

@ -74,6 +74,7 @@ void ZlibDeflatingWriteBuffer::nextImpl()
ZlibDeflatingWriteBuffer::~ZlibDeflatingWriteBuffer()
{
//!
try
{
finalize();

View File

@ -87,6 +87,7 @@ void ZstdDeflatingAppendableWriteBuffer::nextImpl()
ZstdDeflatingAppendableWriteBuffer::~ZstdDeflatingAppendableWriteBuffer()
{
//!
finalize();
}

View File

@ -33,6 +33,7 @@ ZstdDeflatingWriteBuffer::ZstdDeflatingWriteBuffer(
ZstdDeflatingWriteBuffer::~ZstdDeflatingWriteBuffer()
{
//!
finalize();
}

View File

@ -73,6 +73,7 @@ std::shared_ptr<ReadBuffer> WriteBufferToFileSegment::getReadBufferImpl()
WriteBufferToFileSegment::~WriteBufferToFileSegment()
{
//!
try
{
finalize();

View File

@ -184,6 +184,7 @@ struct TemporaryFileStream::OutputWriter
~OutputWriter()
{
//!
try
{
finalize();

View File

@ -171,6 +171,7 @@ void WriteBufferFromHTTPServerResponse::onProgress(const Progress & progress)
WriteBufferFromHTTPServerResponse::~WriteBufferFromHTTPServerResponse()
{
//!
finalize();
}

View File

@ -147,6 +147,7 @@ void WriteBufferFromHDFS::finalizeImpl()
WriteBufferFromHDFS::~WriteBufferFromHDFS()
{
//!
finalize();
}