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

dataroaring 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 0dd5eaf5765 branch-2.1: [fix](heartbeat) avoid failure immediately due 
to connection reset #48444 (#48635)
0dd5eaf5765 is described below

commit 0dd5eaf57659d307c7f0a0361fe8b946fc04960e
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Mar 5 09:52:46 2025 +0800

    branch-2.1: [fix](heartbeat) avoid failure immediately due to connection 
reset #48444 (#48635)
    
    Cherry-picked from #48444
    
    Co-authored-by: Yongqiang YANG <yangyongqi...@selectdb.com>
---
 .../src/main/java/org/apache/doris/system/HeartbeatMgr.java      | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java 
b/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java
index 9a5058f8d02..b42076e0efb 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/system/HeartbeatMgr.java
@@ -225,6 +225,15 @@ public class HeartbeatMgr extends MasterDaemon {
 
         @Override
         public HeartbeatResponse call() {
+            HeartbeatResponse response = pingOnce();
+            // We ping twice here to avoid immediately failure due to 
connection reset.
+            if (response.getStatus() != HbStatus.OK) {
+                response = pingOnce();
+            }
+            return response;
+        }
+
+        private HeartbeatResponse pingOnce() {
             long backendId = backend.getId();
             HeartbeatService.Client client = null;
 


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

Reply via email to