diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index f599434441a9a3..a8b2dbbe630ac4 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 d65047a7301cea..7432dde2b2b2fb 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 8cf0e330aa9c8c..4aaf526281c923 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