[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17354768#comment-17354768
 ] 

kevin yang commented on ZOOKEEPER-4309:
---------------------------------------

 

ExecutorService executor = Executors.newFixedThreadPool(addresses.size());
listenerHandlers.forEach(executor::submit);

try {
 {color:#FF0000}latch.await();{color}
} catch (InterruptedException ie) {
 LOG.error("Interrupted while sleeping. Ignoring exception", ie);
} finally \{...}
{code:java}
// code placeholder
{code}
 

 we use countdownLatch to block that until listenerHandler accept connection. 
You can see countdownLatch.countDown invoked in listenerHandler.run() that we 
pass countdownLatch variable into it via its ctor().

 

so it does not affect memory leak in my concern.

> QuorumCnxManager's ListenerHandler thread leak
> ----------------------------------------------
>
>                 Key: ZOOKEEPER-4309
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4309
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.6.3, 3.7.0
>            Reporter: Francesco Nigro
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> QuorumCnxManager::Listener::run is creating a 
> Executors.newFixedThreadPool(addresses.size()) without shutting it down after 
> ListenerHandler task has been completed causing it to leak.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to