Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,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.
Expand Down
2 changes: 2 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,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,
Expand Down
5 changes: 4 additions & 1 deletion be/src/runtime/fragment_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1062,12 +1062,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);

Expand Down