[ https://issues.apache.org/jira/browse/ARTEMIS-2408?focusedWorklogId=279034&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-279034 ]
ASF GitHub Bot logged work on ARTEMIS-2408: ------------------------------------------- Author: ASF GitHub Bot Created on: 18/Jul/19 14:29 Start Date: 18/Jul/19 14:29 Worklog Time Spent: 10m Work Description: clebertsuconic commented on pull request #2759: ARTEMIS-2408 Too many opened FDs after server stops URL: https://github.com/apache/activemq-artemis/pull/2759#discussion_r304948383 ########## File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java ########## @@ -407,15 +410,28 @@ public void stop(final boolean criticalError) throws Exception { conn.disconnect(criticalError); } + Map<Acceptor, Future<?>> acceptorFutures = new HashMap<>(); for (Acceptor acceptor : acceptors.values()) { try { - acceptor.stop(); + //In some cases an acceptor stopping could be locked ie NettyAcceptor stopping could be locked by a network failure. + acceptorFutures.put(acceptor, acceptor.asyncStop()); Review comment: it would be a lot simpler if instead of returning a future, you passed in a Runnable or Future You could have the following code: ```java // Instead of a Map<Acceptor, Future> CountDownLatch latch = new CountDownLatch(acceptors.size()); for (Acceptor accetor: acceptors.values()) { acceptor.asyncStop(latch::countDown); } ``` and the whole loop on each Future would be replaced by: ```java latch.await(3, TimeUnit.Seconds); ``` You could also use ReusableLatch, and call countUp during the acceptor loop. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 279034) Time Spent: 6h 40m (was: 6.5h) > Too many opened FDs after server stops > -------------------------------------- > > Key: ARTEMIS-2408 > URL: https://issues.apache.org/jira/browse/ARTEMIS-2408 > Project: ActiveMQ Artemis > Issue Type: Bug > Reporter: Domenico Bruscino > Priority: Major > Time Spent: 6h 40m > Remaining Estimate: 0h > > The number of opened FDs after stop the server on the testsuite is much > higher than the number before the server is started, when default netty > configuration is used. > > -- This message was sent by Atlassian JIRA (v7.6.14#76016)