You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2020/12/15 22:25:39 UTC

[hadoop] branch branch-2.10 updated: HADOOP-17068. Client fails forever when namenode ipaddr changed. Contributed by Sean Chow.

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

weichiu pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new 2c45e93  HADOOP-17068. Client fails forever when namenode ipaddr changed. Contributed by Sean Chow.
2c45e93 is described below

commit 2c45e936821b9bff455c03879a7141fde61595b2
Author: He Xiaoqiao <he...@apache.org>
AuthorDate: Tue Jun 23 16:13:43 2020 +0800

    HADOOP-17068. Client fails forever when namenode ipaddr changed. Contributed by Sean Chow.
    
    (cherry picked from commit fa14e4bc001e28d9912e8d985d09bab75aedb87c)
    (cherry picked from commit 3a860e876e799ef44fca34e3cb19a89dbd4f6744)
    (cherry picked from commit 8d7600ae6b7fadba1b4695666cf9287be021d481)
    (cherry picked from commit 1fe15113cf464015212e6ad7ecbca22dc1c50309)
---
 .../src/main/java/org/apache/hadoop/ipc/Client.java         | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
index bb19f79..bcabf00 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
@@ -652,6 +652,7 @@ public class Client implements AutoCloseable {
     
     private synchronized void setupConnection(
         UserGroupInformation ticket) throws IOException {
+      LOG.debug("Setup connection to " + server.toString());
       short ioFailures = 0;
       short timeoutFailures = 0;
       while (true) {
@@ -713,8 +714,16 @@ public class Client implements AutoCloseable {
         } catch (IOException ie) {
           if (updateAddress()) {
             timeoutFailures = ioFailures = 0;
+            try {
+              // HADOOP-17068: when server changed, ignore the exception.
+              handleConnectionFailure(ioFailures++, ie);
+            } catch (IOException ioe) {
+              LOG.warn("Exception when handle ConnectionFailure: "
+                  + ioe.getMessage());
+            }
+          } else {
+            handleConnectionFailure(ioFailures++, ie);
           }
-          handleConnectionFailure(ioFailures++, ie);
         }
       }
     }
@@ -1279,7 +1288,7 @@ public class Client implements AutoCloseable {
           cleanupCalls();
         }
       } else {
-        // log the info
+        // Log the newest server information if update address.
         if (LOG.isDebugEnabled()) {
           LOG.debug("closing ipc connection to " + server + ": " +
               closeException.getMessage(),closeException);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org