HBaseAdmin may leak ZooKeeper connections
When master crashs, HBaseAdmin will leaks ZooKeeper connections
I think we should close the zk connetion when throw MasterNotRunningException
public HBaseAdmin(Configuration c)
throws MasterNotRunningException, ZooKeeperConnectionException {
this.conf = HBaseConfiguration.create(c);
this.connection = HConnectionManager.getConnection(this.conf);
this.pause = this.conf.getLong("hbase.client.pause", 1000);
this.numRetries = this.conf.getInt("hbase.client.retries.number", 10);
this.retryLongerMultiplier = this.conf.getInt("hbase.client.retries.longer.multiplier", 10);
//we should add this code and close the zk connection
try{ this.connection.getMaster(); }catch(MasterNotRunningException e){ HConnectionManager.deleteConnection(conf, false); throw e; }
}
When master crashs, HBaseAdmin will leaks ZooKeeper connections
I think we should close the zk connetion when throw MasterNotRunningException
public HBaseAdmin(Configuration c)
throws MasterNotRunningException, ZooKeeperConnectionException {
this.conf = HBaseConfiguration.create(c);
this.connection = HConnectionManager.getConnection(this.conf);
this.pause = this.conf.getLong("hbase.client.pause", 1000);
this.numRetries = this.conf.getInt("hbase.client.retries.number", 10);
this.retryLongerMultiplier = this.conf.getInt("hbase.client.retries.longer.multiplier", 10);
//we should add this code and close the zk connection
try{ this.connection.getMaster(); }catch(MasterNotRunningException e){ HConnectionManager.deleteConnection(conf, false); throw e; }
}
HBase Admin 在 Master 崩溃时的 ZooKeeper 连接泄露问题解决
本文详细介绍了 HBaseAdmin 在 Master 崩溃时如何泄露 ZooKeeper 连接的问题,并提供了一个解决方案,即在抛出 MasterNotRunningException 异常时关闭 ZooKeeper 连接。通过这种方式,可以有效避免资源泄露,提高系统的稳定性和安全性。
3046

被折叠的 条评论
为什么被折叠?



