[
https://issues.apache.org/jira/browse/HBASE-8483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13648324#comment-13648324
]
Eric Yu commented on HBASE-8483:
--------------------------------
I switched to using createConnection and sharing that connection across
multiple threads, but still ran into possible ZK connection leaks if I closed
the connection while others threads were using it. So far I can only avoid the
problem by putting a check in
ConnectionManager.HConnectionImplementation.getZooKeeperWatcher to not create a
watcher if the hconnection is already closed and synchronize in
HConnectionImplementation.close(boolean) when it is closing zk watcher and
setting the closed indicator to true. Of course, the leak doesn't occur very
much because application doesn't call deleteStaleConnection very often, only
when we think the connection has problems. And the leak doesn't occur every
time we close, only if another thread creates a new watcher after the
hconnection has been closed.
> HConnectionManager can leak ZooKeeper connections when using
> deleteStaleConnection
> ----------------------------------------------------------------------------------
>
> Key: HBASE-8483
> URL: https://issues.apache.org/jira/browse/HBASE-8483
> Project: HBase
> Issue Type: Bug
> Components: Client
> Affects Versions: 0.94.4
> Reporter: Eric Yu
> Priority: Critical
> Fix For: 0.95.1
>
> Attachments: LeakZKConnections.java
>
>
> If one thread calls deleteStaleConnection while other threads are using
> connection, can leak ZK connections.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira