From 946d28646a950c4f0ecd85b5fa3537ddef72bc7b Mon Sep 17 00:00:00 2001 From: daidai <2017501503@qq.com> Date: Sun, 28 Apr 2024 19:54:34 +0800 Subject: [PATCH] [fix](outfile)Fixed orcOutputStream.close() throwing an exception during destruction causing the program to hang. (#34254) bp #34243 --- be/src/vec/runtime/vorc_transformer.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/be/src/vec/runtime/vorc_transformer.cpp b/be/src/vec/runtime/vorc_transformer.cpp index a07f734aca..3bf3d8cea7 100644 --- a/be/src/vec/runtime/vorc_transformer.cpp +++ b/be/src/vec/runtime/vorc_transformer.cpp @@ -62,7 +62,16 @@ VOrcOutputStream::VOrcOutputStream(doris::io::FileWriter* file_writer) VOrcOutputStream::~VOrcOutputStream() { if (!_is_closed) { - close(); + try { + close(); + } catch (...) { + /* + * Under normal circumstances, close() will be called first, and then the destructor will be called. + * If the task is canceled, close() will not be executed, but the destructor will be called directly, + * which will cause the be core.When the task is canceled, since the log file has been written during + * close(), no operation is performed here. + */ + } } }