You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2019/07/17 07:34:22 UTC

[GitHub] [activemq-artemis] brusdev commented on a change in pull request #2756: ARTEMIS-2408 Effectively reverting FileDescriptors check as testsuite…

brusdev commented on a change in pull request #2756: ARTEMIS-2408 Effectively reverting FileDescriptors check as testsuite…
URL: https://github.com/apache/activemq-artemis/pull/2756#discussion_r304257386
 
 

 ##########
 File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
 ##########
 @@ -408,27 +407,15 @@ public void stop(final boolean criticalError) throws Exception {
          conn.disconnect(criticalError);
       }
 
-      Map<Acceptor, Future<?>> acceptorFutures = new HashMap<>();
       for (Acceptor acceptor : acceptors.values()) {
          try {
-            acceptorFutures.put(acceptor, acceptor.asyncStop());
+            acceptor.stop();
          } catch (Throwable t) {
             ActiveMQServerLogger.LOGGER.errorStoppingAcceptor(acceptor.getName());
          }
       }
 
-      for (Map.Entry<Acceptor, Future<?>> acceptorFuture : acceptorFutures.entrySet()) {
-         if (acceptorFuture.getValue() != null) {
-            try {
-               acceptorFuture.getValue().get();
 
 Review comment:
   I totally agree on the need for a timeout. On my machine it takes 1.5 seconds in the worst case, wdyt about a total timeout of 3 seconds?
   
   An example just to clarify what I mean:
   
   >       long acceptorTimeout = System.currentTimeMillis() + 3000;
   >       for (Map.Entry<Acceptor, Future<?>> acceptorFuture : acceptorFutures.entrySet()) {
   >          if (acceptorFuture.getValue() != null) {
   >             try {
   >                acceptorFuture.getValue().get(Math.max(0, acceptorTimeout - System.currentTimeMillis()), TimeUnit.MILLISECONDS);
   >             } catch (Throwable t) {
   >                ActiveMQServerLogger.LOGGER.errorStoppingAcceptor(acceptorFuture.getKey().getName());
   >             }
   >          }
   >       }
   > 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services