diff --git a/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 4c703399f12..fb9b9ee81f8 100644 --- a/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -1289,6 +1289,10 @@ public class HConnectionManager { HBaseRPC.stopProxy(i); } } + if (zooKeeper != null) { + zooKeeper.close(); + zooKeeper = null; + } } /** @@ -1523,10 +1527,6 @@ public class HConnectionManager { public void abort(final String msg, Throwable t) { if (t != null) LOG.fatal(msg, t); else LOG.fatal(msg); - if(zooKeeper != null) { - zooKeeper.close(); - zooKeeper = null; - } } } } diff --git a/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java b/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java index a758faeacb4..d2aac58c91d 100644 --- a/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java +++ b/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManager.java @@ -44,6 +44,7 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import java.net.URLEncoder;