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

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


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 60b5c22eb75 branch-3.1: [chore](config) add config for 
brpc::usercode_in_pthread to let asan #54656 (#54829)
60b5c22eb75 is described below

commit 60b5c22eb75e3ed2b30422bfce73981ca36e69f5
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Sep 4 09:45:01 2025 +0800

    branch-3.1: [chore](config) add config for brpc::usercode_in_pthread to let 
asan #54656 (#54829)
    
    Cherry-picked from #54656
    
    Co-authored-by: Yongqiang YANG <[email protected]>
    Co-authored-by: Yongqiang YANG <[email protected]>
---
 be/src/common/config.cpp        | 2 ++
 be/src/common/config.h          | 2 ++
 be/src/service/brpc_service.cpp | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index b08b0cab45f..5234d12b3a4 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -786,6 +786,8 @@ DEFINE_String(default_rowset_type, "BETA");
 // Maximum size of a single message body in all protocols
 DEFINE_Int64(brpc_max_body_size, "3147483648");
 DEFINE_Int64(brpc_socket_max_unwritten_bytes, "-1");
+DEFINE_mBool(brpc_usercode_in_pthread, "false");
+
 // TODO(zxy): expect to be true in v1.3
 // Whether to embed the ProtoBuf Request serialized string together with 
Tuple/Block data into
 // Controller Attachment and send it through http brpc when the length of the 
Tuple/Block data
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 294b4cd5973..fe6dedc63b9 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -830,6 +830,8 @@ DECLARE_Int64(brpc_max_body_size);
 // Default, if the physical memory is less than or equal to 64G, the value is 
1G
 //          if the physical memory is greater than 64G, the value is physical 
memory * mem_limit(0.8) / 1024 * 20
 DECLARE_Int64(brpc_socket_max_unwritten_bytes);
+// Whether to set FLAGS_usercode_in_pthread to true in brpc
+DECLARE_mBool(brpc_usercode_in_pthread);
 // TODO(zxy): expect to be true in v1.3
 // Whether to embed the ProtoBuf Request serialized string together with 
Tuple/Block data into
 // Controller Attachment and send it through http brpc when the length of the 
Tuple/Block data
diff --git a/be/src/service/brpc_service.cpp b/be/src/service/brpc_service.cpp
index 8cf0e330aa9..4aaf526281c 100644
--- a/be/src/service/brpc_service.cpp
+++ b/be/src/service/brpc_service.cpp
@@ -41,6 +41,7 @@ namespace brpc {
 
 DECLARE_uint64(max_body_size);
 DECLARE_int64(socket_max_unwritten_bytes);
+DECLARE_bool(usercode_in_pthread);
 
 } // namespace brpc
 
@@ -48,6 +49,9 @@ namespace doris {
 
 BRpcService::BRpcService(ExecEnv* exec_env) : _exec_env(exec_env), _server(new 
brpc::Server()) {
     // Set config
+    if (config::brpc_usercode_in_pthread) {
+        brpc::FLAGS_usercode_in_pthread = true;
+    }
     brpc::FLAGS_max_body_size = config::brpc_max_body_size;
     brpc::FLAGS_socket_max_unwritten_bytes =
             config::brpc_socket_max_unwritten_bytes != -1


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

Reply via email to