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 071a2106a3c branch-2.1: [opt](brpc) Make the timeout of brpc checking
configurable #44481 (#44602)
071a2106a3c is described below
commit 071a2106a3cd1c1be16b4dc0b060b868bc825c51
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Nov 26 19:26:39 2024 +0800
branch-2.1: [opt](brpc) Make the timeout of brpc checking configurable
#44481 (#44602)
Cherry-picked from #44481
Co-authored-by: Jerry Hu <[email protected]>
---
be/src/common/config.cpp | 2 ++
be/src/common/config.h | 2 ++
be/src/runtime/fragment_mgr.cpp | 5 ++++-
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index c41f19a3e27..e376ab03bfd 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -556,6 +556,8 @@ DEFINE_Bool(enable_brpc_builtin_services, "true");
// Enable brpc connection check
DEFINE_Bool(enable_brpc_connection_check, "false");
+DEFINE_mInt64(brpc_connection_check_timeout_ms, "10000");
+
// The maximum amount of data that can be processed by a stream load
DEFINE_mInt64(streaming_load_max_mb, "102400");
// Some data formats, such as JSON, cannot be streamed.
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 7693af0f7ae..06f356f5fe8 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1040,6 +1040,8 @@ DECLARE_Bool(enable_brpc_builtin_services);
DECLARE_Bool(enable_brpc_connection_check);
+DECLARE_mInt64(brpc_connection_check_timeout_ms);
+
// Max waiting time to wait the "plan fragment start" rpc.
// If timeout, the fragment will be cancelled.
// This parameter is usually only used when the FE loses connection,
diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp
index 53c9c01a470..334b413b44b 100644
--- a/be/src/runtime/fragment_mgr.cpp
+++ b/be/src/runtime/fragment_mgr.cpp
@@ -1478,12 +1478,15 @@ void FragmentMgr::_check_brpc_available(const
std::shared_ptr<PBackendService_St
const std::string message = "hello doris!";
std::string error_message;
int32_t failed_count = 0;
+ const int64_t check_timeout_ms =
+ std::max<int64_t>(100, config::brpc_connection_check_timeout_ms);
+
while (true) {
PHandShakeRequest request;
request.set_hello(message);
PHandShakeResponse response;
brpc::Controller cntl;
- cntl.set_timeout_ms(500 * (failed_count + 1));
+ cntl.set_timeout_ms(check_timeout_ms);
cntl.set_max_retry(10);
brpc_stub->hand_shake(&cntl, &request, &response, nullptr);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]