[
https://issues.apache.org/jira/browse/CURATOR-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16212346#comment-16212346
]
zealot edited comment on CURATOR-437 at 10/20/17 8:38 AM:
----------------------------------------------------------
Scala script to reproduse
{code:java}
<start zk server>
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "debug")
System.setProperty("org.slf4j.simpleLogger.showDateTime", "true")
System.setProperty("org.slf4j.simpleLogger.dateTimeFormat",
"yyyy-MM-dd'T'HH:mm:ss.SSSZ")
:require /usr/share/java/slf4j-api.jar
:require /usr/share/java/slf4j-simple-1.7.22.jar
:require zookeeper-3.5.3-beta.jar
:require curator-framework-4.0.0.jar
:require curator-client-4.0.0.jar
:require guava-18.0.jar
val cf =
org.apache.curator.framework.CuratorFrameworkFactory.newClient("10.185.0.93:2181,10.185.0.94:2181,10.185.0.95:2181",
new org.apache.curator.retry.RetryForever(3000))
cf.start()
<stop zk server>
<wait session timeout>
<start zk server>
{code}
I also attached full debug log.
It isn't 100% reproducible, I tried three times, and successfully reproduced
twice.
was (Author: zealot0630):
Scala script to reproduse
{code:java}
<start zk server>
System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "debug")
:require /usr/share/java/slf4j-api.jar
:require /usr/share/java/slf4j-simple-1.7.22.jar
:require zookeeper-3.5.3-beta.jar
:require curator-framework-4.0.0.jar
:require curator-client-4.0.0.jar
:require guava-18.0.jar
val cf =
org.apache.curator.framework.CuratorFrameworkFactory.newClient("10.185.0.93:2181,10.185.0.94:2181,10.185.0.95:2181",
new org.apache.curator.retry.RetryForever(3000))
cf.start()
<stop zk server, wait session timeout>
{code}
I also attached full debug log.
It isn't 100% reproducible, I tried three times, and successfully reproduced
twice.
> zookeeper connection leak when session expires.
> -----------------------------------------------
>
> Key: CURATOR-437
> URL: https://issues.apache.org/jira/browse/CURATOR-437
> Project: Apache Curator
> Issue Type: Bug
> Components: Client
> Affects Versions: 4.0.0
> Reporter: zealot
>
> https://github.com/apache/curator/blob/master/curator-client/src/main/java/org/apache/curator/utils/InjectSessionExpiration.java#L97
> Curator inject will set zookeeper state to CLOSED when session expires
> without close zk associated threads.
> If state set to CLOSED, ZooKeeper.close() function won't be able to release
> resources properly, which lead to memory and connection leak.
> To reproduce, create a curator client, then shutdown zk server, wait for
> session timeout, restart the zk server. There will be two ZooKeeper instances
> and two connections to the server.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)