HBASE-4417 HBaseAdmin.checkHBaseAvailable() doesn't close ZooKeeper connections
(Stefan Seelmann) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1171734 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
db102ed307
commit
879ab1b8fb
|
@ -275,6 +275,8 @@ Release 0.91.0 - Unreleased
|
|||
HBASE-4322 HBASE-4322 [hbck] Update checkIntegrity/checkRegionChain
|
||||
to present more accurate region split problem
|
||||
(Jon Hseih)
|
||||
HBASE-4417 HBaseAdmin.checkHBaseAvailable() doesn't close ZooKeeper connections
|
||||
(Stefan Seelmann)
|
||||
|
||||
IMPROVEMENTS
|
||||
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
|
||||
|
|
|
@ -1576,7 +1576,12 @@ public class HBaseAdmin implements Abortable, Closeable {
|
|||
throws MasterNotRunningException, ZooKeeperConnectionException {
|
||||
Configuration copyOfConf = HBaseConfiguration.create(conf);
|
||||
copyOfConf.setInt("hbase.client.retries.number", 1);
|
||||
new HBaseAdmin(copyOfConf);
|
||||
HBaseAdmin admin = new HBaseAdmin(copyOfConf);
|
||||
try {
|
||||
admin.close();
|
||||
} catch (IOException ioe) {
|
||||
admin.LOG.info("Failed to close connection", ioe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1268,4 +1268,15 @@ public class TestAdmin {
|
|||
return regionServer;
|
||||
}
|
||||
|
||||
/**
|
||||
* HBASE-4417 checkHBaseAvailable() doesn't close zk connections
|
||||
*/
|
||||
@Test
|
||||
public void testCheckHBaseAvailableClosesConnection() throws Exception {
|
||||
Configuration conf = TEST_UTIL.getConfiguration();
|
||||
for(int i=0; i<1000;i++) {
|
||||
HBaseAdmin.checkHBaseAvailable(conf);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue