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

yiguolei pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 6c0a1836714 [bug](exchange) Fix core dump if prepare failed (#28371)
6c0a1836714 is described below

commit 6c0a1836714258dda9853dd2e90c4d18d6c322c0
Author: Gabriel <[email protected]>
AuthorDate: Thu Dec 14 12:37:50 2023 +0800

    [bug](exchange) Fix core dump if prepare failed (#28371)
    
    * [bug](exchange) Fix core dump if prepare failed (#28363)
    
    * update
---
 be/src/pipeline/exec/exchange_sink_operator.cpp | 6 ++++--
 be/src/pipeline/exec/exchange_sink_operator.h   | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/be/src/pipeline/exec/exchange_sink_operator.cpp 
b/be/src/pipeline/exec/exchange_sink_operator.cpp
index 79517e8b041..a62e1aedbc8 100644
--- a/be/src/pipeline/exec/exchange_sink_operator.cpp
+++ b/be/src/pipeline/exec/exchange_sink_operator.cpp
@@ -83,8 +83,10 @@ bool ExchangeSinkOperator::is_pending_finish() const {
 
 Status ExchangeSinkOperator::close(RuntimeState* state) {
     RETURN_IF_ERROR(DataSinkOperator::close(state));
-    _sink_buffer->update_profile(_sink->profile());
-    _sink_buffer->close();
+    if (_sink_buffer) {
+        _sink_buffer->update_profile(_sink->profile());
+        _sink_buffer->close();
+    }
     return Status::OK();
 }
 
diff --git a/be/src/pipeline/exec/exchange_sink_operator.h 
b/be/src/pipeline/exec/exchange_sink_operator.h
index cbce047fb81..e1527276559 100644
--- a/be/src/pipeline/exec/exchange_sink_operator.h
+++ b/be/src/pipeline/exec/exchange_sink_operator.h
@@ -61,7 +61,7 @@ public:
     Status close(RuntimeState* state) override;
 
 private:
-    std::unique_ptr<ExchangeSinkBuffer> _sink_buffer;
+    std::unique_ptr<ExchangeSinkBuffer> _sink_buffer = nullptr;
     int _dest_node_id = -1;
     RuntimeState* _state = nullptr;
     PipelineFragmentContext* _context;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to