gavinchou commented on code in PR #59698:
URL: https://github.com/apache/doris/pull/59698#discussion_r2673179835


##########
be/src/util/thrift_rpc_helper.cpp:
##########
@@ -85,15 +94,36 @@ Status ThriftRpcHelper::rpc(const std::string& ip, const 
int32_t port,
 #endif
             std::this_thread::sleep_for(
                     
std::chrono::milliseconds(config::thrift_client_retry_interval_ms));
-            status = client.reopen(timeout_ms);
-            if (!status.ok()) {
+            TNetworkAddress retry_address = address_provider();
+            if (retry_address.hostname.empty() || retry_address.port == 0) {
+                return Status::Error<ErrorCode::SERVICE_UNAVAILABLE>("FE 
address is not available");
+            }
+            if (retry_address.hostname != address.hostname || 
retry_address.port != address.port) {
+#ifndef ADDRESS_SANITIZER
+                LOG(INFO) << "retrying call frontend service with new 
address=" << retry_address;

Review Comment:
   why not just log without check `ifndef address`? 



##########
be/src/util/thrift_rpc_helper.cpp:
##########
@@ -85,15 +94,36 @@ Status ThriftRpcHelper::rpc(const std::string& ip, const 
int32_t port,
 #endif
             std::this_thread::sleep_for(
                     
std::chrono::milliseconds(config::thrift_client_retry_interval_ms));
-            status = client.reopen(timeout_ms);
-            if (!status.ok()) {
+            TNetworkAddress retry_address = address_provider();
+            if (retry_address.hostname.empty() || retry_address.port == 0) {
+                return Status::Error<ErrorCode::SERVICE_UNAVAILABLE>("FE 
address is not available");
+            }
+            if (retry_address.hostname != address.hostname || 
retry_address.port != address.port) {
+#ifndef ADDRESS_SANITIZER
+                LOG(INFO) << "retrying call frontend service with new 
address=" << retry_address;
+#endif
+                Status retry_status;
+                ClientConnection<T> 
retry_client(_s_exec_env->get_client_cache<T>(), retry_address,
+                                                 timeout_ms, &retry_status);
+                if (!retry_status.ok()) {
+#ifndef ADDRESS_SANITIZER
+                    LOG(WARNING) << "Connect frontend failed, address=" << 
retry_address

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to