This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 74ca8f9869b [chore](client) Reopen client if exception is catched 
(#36808)
74ca8f9869b is described below

commit 74ca8f9869bf8fc3663697bad6a2dd6cd9d33c73
Author: walter <w41te...@gmail.com>
AuthorDate: Wed Jun 26 10:20:20 2024 +0800

    [chore](client) Reopen client if exception is catched (#36808)
    
    It was introduced by #34994.
---
 be/src/agent/utils.cpp | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/be/src/agent/utils.cpp b/be/src/agent/utils.cpp
index c6a801c7a93..6038733e769 100644
--- a/be/src/agent/utils.cpp
+++ b/be/src/agent/utils.cpp
@@ -91,19 +91,19 @@ Status MasterServerClient::finish_task(const 
TFinishTaskRequest& request, TMaste
             client->finishTask(*result, request);
         } catch (TTransportException& e) {
 #ifdef ADDRESS_SANITIZER
-            return Status::RpcError<false>("Master client finish task failed 
due to {}", e.what());
-#else
             LOG(WARNING) << "master client, retry finishTask: " << e.what();
+#endif
             client_status = client.reopen(config::thrift_rpc_timeout_ms);
             if (!client_status.ok()) {
+#ifdef ADDRESS_SANITIZER
                 LOG(WARNING) << "fail to get master client from cache. "
                              << "host=" << 
_master_info.network_address.hostname
                              << ", port=" << _master_info.network_address.port
                              << ", code=" << client_status.code();
+#endif
                 return Status::RpcError("Master client finish task failed");
             }
             client->finishTask(*result, request);
-#endif
         }
     } catch (std::exception& e) {
         RETURN_IF_ERROR(client.reopen(config::thrift_rpc_timeout_ms));
@@ -133,20 +133,21 @@ Status MasterServerClient::report(const TReportRequest& 
request, TMasterResult*
         try {
             client->report(*result, request);
         } catch (TTransportException& e) {
-#ifdef ADDRESS_SANITIZER
-            return Status::RpcError<false>("Master client report failed due to 
{}", e.what());
-#else
             TTransportException::TTransportExceptionType type = e.getType();
             if (type != 
TTransportException::TTransportExceptionType::TIMED_OUT) {
+#ifdef ADDRESS_SANITIZER
                 // if not TIMED_OUT, retry
                 LOG(WARNING) << "master client, retry finishTask: " << 
e.what();
+#endif
 
                 client_status = client.reopen(config::thrift_rpc_timeout_ms);
                 if (!client_status.ok()) {
+#ifdef ADDRESS_SANITIZER
                     LOG(WARNING) << "fail to get master client from cache. "
                                  << "host=" << 
_master_info.network_address.hostname
                                  << ", port=" << 
_master_info.network_address.port
                                  << ", code=" << client_status.code();
+#endif
                     return Status::InternalError("Fail to get master client 
from cache");
                 }
 
@@ -154,10 +155,11 @@ Status MasterServerClient::report(const TReportRequest& 
request, TMasterResult*
             } else {
                 // TIMED_OUT exception. do not retry
                 // actually we don't care what FE returns.
+#ifdef ADDRESS_SANITIZER
                 LOG(WARNING) << "fail to report to master: " << e.what();
+#endif
                 return Status::InternalError("Fail to report to master");
             }
-#endif
         }
     } catch (std::exception& e) {
         RETURN_IF_ERROR(client.reopen(config::thrift_rpc_timeout_ms));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to