diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 56b5e4dde98..fb702c021af 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -595,6 +595,9 @@ Release 2.0.3-alpha - Unreleased HDFS-4104. dfs -test -d prints inappropriate error on nonexistent directory (Andy Isaacson via daryn) + HDFS-3623. BKJM: zkLatchWaitTimeout hard coded to 6000. Make use of ZKSessionTimeout instead. + (umamahesh) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperJournalManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperJournalManager.java index 67f0b4b2293..6d9a65d2821 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperJournalManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperJournalManager.java @@ -180,9 +180,16 @@ public class BookKeeperJournalManager implements JournalManager { try { zkConnectLatch = new CountDownLatch(1); - zkc = new ZooKeeper(zkConnect, conf.getInt(BKJM_ZK_SESSION_TIMEOUT, - BKJM_ZK_SESSION_TIMEOUT_DEFAULT), new ZkConnectionWatcher()); - if (!zkConnectLatch.await(6000, TimeUnit.MILLISECONDS)) { + int bkjmZKSessionTimeout = conf.getInt(BKJM_ZK_SESSION_TIMEOUT, + BKJM_ZK_SESSION_TIMEOUT_DEFAULT); + zkc = new ZooKeeper(zkConnect, bkjmZKSessionTimeout, + new ZkConnectionWatcher()); + // Configured zk session timeout + some extra grace period (here + // BKJM_ZK_SESSION_TIMEOUT_DEFAULT used as grace period) + int zkConnectionLatchTimeout = bkjmZKSessionTimeout + + BKJM_ZK_SESSION_TIMEOUT_DEFAULT; + if (!zkConnectLatch + .await(zkConnectionLatchTimeout, TimeUnit.MILLISECONDS)) { throw new IOException("Error connecting to zookeeper"); }