Skip to content

Commit

Permalink
[BugFix] Fix thrift not call when retry times = 0 (#52067)
Browse files Browse the repository at this point in the history
Signed-off-by: stdpain <[email protected]>
  • Loading branch information
stdpain authored Oct 18, 2024
1 parent c46e2b9 commit a601695
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions be/src/util/thrift_rpc_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ Status ThriftRpcHelper::rpc(const std::string& ip, const int32_t port,
Status status;
ClientConnection<T> client(_s_exec_env->get_client_cache<T>(), address, timeout_ms, &status);
if (!status.ok()) {
_s_exec_env->get_client_cache<T>()->close_connections(address);
LOG(WARNING) << "Connect " << ThriftMsgTypeTraits<T>::rpc_name << " failed, address=" << address
<< ", status=" << status.message();
return status;
}

for (int i = 0; i < retry_times; i++) {
int i = 0;
do {
status = rpc_impl(callback, client, address);
if (status.ok()) {
return Status::OK();
Expand All @@ -121,7 +123,7 @@ Status ThriftRpcHelper::rpc(const std::string& ip, const int32_t port,
LOG(WARNING) << "client reopen failed. address=" << address << ", status=" << st.message();
break;
}
}
} while (i++ < retry_times);
return status;
}

Expand Down

0 comments on commit a601695

Please sign in to comment.