This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new da27039fe4 [Fix](load) Fix memory leak for stream load 2pc #16430
da27039fe4 is described below
commit da27039fe4bf03aa7c5e07c80cc0065d368c245c
Author: weizuo93 <[email protected]>
AuthorDate: Mon Feb 6 15:52:17 2023 +0800
[Fix](load) Fix memory leak for stream load 2pc #16430
StreamLoadContext is not deleted correctly.
Co-authored-by: weizuo <[email protected]>
---
be/src/http/action/stream_load_2pc.cpp | 14 ++++++++++++++
be/src/http/action/stream_load_2pc.h | 1 +
2 files changed, 15 insertions(+)
diff --git a/be/src/http/action/stream_load_2pc.cpp
b/be/src/http/action/stream_load_2pc.cpp
index 626025d334..bcc4d9f288 100644
--- a/be/src/http/action/stream_load_2pc.cpp
+++ b/be/src/http/action/stream_load_2pc.cpp
@@ -93,4 +93,18 @@ std::string StreamLoad2PCAction::get_success_info(const
std::string txn_id,
return s.GetString();
}
+void StreamLoad2PCAction::free_handler_ctx(void* param) {
+ StreamLoadContext* ctx = (StreamLoadContext*)param;
+ if (ctx == nullptr) {
+ return;
+ }
+ // sender is gone, make receiver know it
+ if (ctx->body_sink != nullptr) {
+ ctx->body_sink->cancel("sender is gone");
+ }
+ if (ctx->unref()) {
+ delete ctx;
+ }
+}
+
} // namespace doris
diff --git a/be/src/http/action/stream_load_2pc.h
b/be/src/http/action/stream_load_2pc.h
index 1a1013a12b..960850e20e 100644
--- a/be/src/http/action/stream_load_2pc.h
+++ b/be/src/http/action/stream_load_2pc.h
@@ -33,6 +33,7 @@ public:
void handle(HttpRequest* req) override;
std::string get_success_info(const std::string txn_id, const std::string
txn_operation);
+ void free_handler_ctx(void* param) override;
private:
ExecEnv* _exec_env;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]