From e27a427f9be88df6225564911cba585bd9eda5ff Mon Sep 17 00:00:00 2001 From: Lars Hofhansl Date: Tue, 26 Aug 2014 10:51:08 -0700 Subject: [PATCH] HBASE-9746 Addendum. --- .../hadoop/hbase/zookeeper/RecoverableZooKeeper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java index 519e04c9f8c..0614bfed747 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java @@ -130,7 +130,7 @@ public class RecoverableZooKeeper { /** * Try to create a Zookeeper connection. Turns any exception encountered into a - * {@link KeeperException.OperationTimeoutException} so it can retried. + * KeeperException.OperationTimeoutException so it can retried. * @return The created Zookeeper connection object * @throws KeeperException */ @@ -138,8 +138,8 @@ public class RecoverableZooKeeper { if (this.zk == null) { try { this.zk = new ZooKeeper(quorumServers, sessionTimeout, watcher); - } catch (Exception uhe) { - LOG.warn("Unable to create ZooKeeper Connection", uhe); + } catch (IOException ex) { + LOG.warn("Unable to create ZooKeeper Connection", ex); throw new KeeperException.OperationTimeoutException(); } } @@ -152,6 +152,8 @@ public class RecoverableZooKeeper { LOG.info("Closing dead ZooKeeper connection, session" + " was: 0x"+Long.toHexString(zk.getSessionId())); zk.close(); + // reset the Zookeeper connection + zk = null; } checkZk(); LOG.info("Recreated a ZooKeeper, session" +