From 8f2622b6a0603f92e8b5784879da28d3d5797fc1 Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Mon, 1 Feb 2016 14:10:55 +0530 Subject: [PATCH] HDFS-9659. EditLogTailerThread to Active Namenode RPC should timeout (Contributed by surendra singh lilhore) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/namenode/ha/EditLogTailer.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 432e6863ae6..5a8b525eaea 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/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 diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java index 6e60dbab7ff..405bf4fe117 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/EditLogTailer.java +++ b/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) {