clebertsuconic commented on a change in pull request #2759: ARTEMIS-2408 Too
many opened FDs after server stops
URL: https://github.com/apache/activemq-artemis/pull/2759#discussion_r305005899
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
##########
@@ -407,13 +409,16 @@ public void stop(final boolean criticalError) throws
Exception {
conn.disconnect(criticalError);
}
+ CountDownLatch acceptorCountDownLatch = new
CountDownLatch(acceptors.size());
for (Acceptor acceptor : acceptors.values()) {
try {
- acceptor.stop();
+ acceptor.asyncStop(() -> acceptorCountDownLatch.countDown());
} catch (Throwable t) {
ActiveMQServerLogger.LOGGER.errorStoppingAcceptor(acceptor.getName());
}
}
+ //In some cases an acceptor stopping could be locked ie NettyAcceptor
stopping could be locked by a network failure.
+ acceptorCountDownLatch.await(ACCEPTOR_STOP_TIMEOUT,
TimeUnit.MILLISECONDS);
Review comment:
a lot easier to read :)
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services