You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/06/01 15:29:10 UTC
[incubator-doris] 15/22: [Bugfix(Vec)] Close result_sink properly (#9849)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
commit fe32d8ffff7f4542ea46536c481adb4efe9b007b
Author: Amos Bird <am...@gmail.com>
AuthorDate: Mon May 30 19:03:33 2022 +0800
[Bugfix(Vec)] Close result_sink properly (#9849)
Close result_sink properly so that error code is reported and
expr_context is always closed.
---
be/src/vec/sink/result_sink.cpp | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/be/src/vec/sink/result_sink.cpp b/be/src/vec/sink/result_sink.cpp
index bc714470eb..e3db9fef32 100644
--- a/be/src/vec/sink/result_sink.cpp
+++ b/be/src/vec/sink/result_sink.cpp
@@ -103,21 +103,24 @@ Status VResultSink::send(RuntimeState* state, Block* block) {
}
Status VResultSink::close(RuntimeState* state, Status exec_status) {
- if (_closed || _writer == nullptr|| _sender == nullptr) {
+ if (_closed) {
return Status::OK();
}
Status final_status = exec_status;
- // close the writer
- Status st = _writer->close();
- if (!st.ok() && exec_status.ok()) {
- // close file writer failed, should return this error to client
- final_status = st;
+
+ if (_writer) {
+ // close the writer
+ Status st = _writer->close();
+ if (!st.ok() && exec_status.ok()) {
+ // close file writer failed, should return this error to client
+ final_status = st;
+ }
}
// close sender, this is normal path end
if (_sender) {
- _sender->update_num_written_rows(_writer->get_written_rows());
+ if (_writer) _sender->update_num_written_rows(_writer->get_written_rows());
_sender->close(final_status);
}
state->exec_env()->result_mgr()->cancel_at_time(
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org