HBASE-13797 Fix resource leak in HBaseFsck

This commit is contained in:
tedyu 2015-05-28 19:18:27 -07:00
parent eea28a334c
commit 365ddfaf58
1 changed files with 5 additions and 1 deletions

View File

@ -3327,7 +3327,11 @@ public class HBaseFsck extends Configured implements Closeable {
KeeperException {
undeployRegions(hi);
ZooKeeperWatcher zkw = createZooKeeperWatcher();
ZKUtil.deleteNode(zkw, zkw.getZNodeForReplica(hi.metaEntry.getReplicaId()));
try {
ZKUtil.deleteNode(zkw, zkw.getZNodeForReplica(hi.metaEntry.getReplicaId()));
} finally {
zkw.close();
}
}
private void assignMetaReplica(int replicaId)