You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by th...@apache.org on 2022/04/30 00:54:42 UTC

[avro] branch master updated: AVRO-2870: Avoid throwing from destructor in DataFileWriterBase (#921)

This is an automated email from the ASF dual-hosted git repository.

thiru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 76e55d877 AVRO-2870: Avoid throwing from destructor in DataFileWriterBase (#921)
76e55d877 is described below

commit 76e55d8775efb02b5248aadf0bd512b137b58443
Author: Andrew Onyshchuk <an...@gmail.com>
AuthorDate: Fri Apr 29 17:54:36 2022 -0700

    AVRO-2870: Avoid throwing from destructor in DataFileWriterBase (#921)
    
    Co-authored-by: Thiruvalluvan M G <th...@apache.org>
---
 lang/c++/impl/DataFile.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lang/c++/impl/DataFile.cc b/lang/c++/impl/DataFile.cc
index b0c574630..32f27ff22 100644
--- a/lang/c++/impl/DataFile.cc
+++ b/lang/c++/impl/DataFile.cc
@@ -118,9 +118,12 @@ void DataFileWriterBase::init(const ValidSchema &schema, size_t syncInterval, co
     lastSync_ = stream_->byteCount();
 }
 
-DataFileWriterBase::~DataFileWriterBase() {
+DataFileWriterBase::~DataFileWriterBase()
+{
     if (stream_) {
-        close();
+        try {
+            close();
+        } catch(...) {}
     }
 }