Browse Source

HDFS-9659. EditLogTailerThread to Active Namenode RPC should timeout (Contributed by surendra singh lilhore)

Vinayakumar B 9 years ago
parent
commit
8f2622b6a0

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -903,6 +903,9 @@ Trunk (Unreleased)
       HDFS-9575. Use byte array for internal block indices in a striped block.
       (jing9 via szetszwo)
 
+      HDFS-9659. EditLogTailerThread to Active Namenode RPC should timeout
+      (surendra singh lilhore via vinayakumarb)
+
 Release 2.9.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 5 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java

@@ -450,8 +450,12 @@ public class EditLogTailer {
 
           currentNN = nnLookup.next();
           try {
+            int rpcTimeout = conf.getInt(
+                DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_KEY,
+                DFSConfigKeys.DFS_HA_LOGROLL_RPC_TIMEOUT_DEFAULT);
             NamenodeProtocolPB proxy = RPC.waitForProxy(NamenodeProtocolPB.class,
-                RPC.getProtocolVersion(NamenodeProtocolPB.class), currentNN.getIpcAddress(), conf);
+                RPC.getProtocolVersion(NamenodeProtocolPB.class), currentNN.getIpcAddress(), conf,
+                rpcTimeout, Long.MAX_VALUE);
             cachedActiveProxy = new NamenodeProtocolTranslatorPB(proxy);
             break;
           } catch (IOException e) {