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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 6f1d9812bbb [Bug](brpc) fix sync_filter_size/apply_filterv2 has wrong 
closure (#39299)
6f1d9812bbb is described below

commit 6f1d9812bbb5b5e5d4714e29a00559365007e2ec
Author: Pxl <pxl...@qq.com>
AuthorDate: Tue Aug 13 19:01:22 2024 +0800

    [Bug](brpc) fix sync_filter_size/apply_filterv2 has wrong closure (#39299)
    
    pick from #39155
---
 be/src/runtime/runtime_filter_mgr.cpp | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/be/src/runtime/runtime_filter_mgr.cpp 
b/be/src/runtime/runtime_filter_mgr.cpp
index 77736e8407a..050f122e0a4 100644
--- a/be/src/runtime/runtime_filter_mgr.cpp
+++ b/be/src/runtime/runtime_filter_mgr.cpp
@@ -361,7 +361,7 @@ Status 
RuntimeFilterMergeControllerEntity::send_filter_size(const PSendFilterSiz
             closure->request_->set_filter_size(cnt_val->global_size);
 
             stub->sync_filter_size(closure->cntl_.get(), 
closure->request_.get(),
-                                   closure->response_.get(), 
brpc::DoNothing());
+                                   closure->response_.get(), closure.get());
             closure.release();
         }
     }
@@ -459,7 +459,11 @@ Status RuntimeFilterMergeControllerEntity::merge(const 
PMergeFilterRequest* requ
             }
 
             if (data != nullptr && len > 0) {
-                request_attachment.append(data, len);
+                void* allocated = malloc(len);
+                memcpy(allocated, data, len);
+                // control the memory by doris self to avoid using brpc's 
thread local storage
+                // because the memory of tls will not be released
+                request_attachment.append_user_data(allocated, len, [](void* 
ptr) { free(ptr); });
                 has_attachment = true;
             }
 
@@ -534,7 +538,11 @@ Status RuntimeFilterMergeControllerEntity::merge(const 
PMergeFilterRequest* requ
             }
 
             if (data != nullptr && len > 0) {
-                request_attachment.append(data, len);
+                void* allocated = malloc(len);
+                memcpy(allocated, data, len);
+                // control the memory by doris self to avoid using brpc's 
thread local storage
+                // because the memory of tls will not be released
+                request_attachment.append_user_data(allocated, len, [](void* 
ptr) { free(ptr); });
                 has_attachment = true;
             }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to