1 2 Previous Next 16 Replies Latest reply on Oct 29, 2007 12:14 PM by clebert.suconic Go to original post
      • 15. Re: Deadlock in JBoss Messaging during JBoss5 shutdown
        timfox

        The problem is that your code does account for the case where FailoverCommandCenter == null (non clustered), but it's not a MessagingShutdownException

        • 16. Re: Deadlock in JBoss Messaging during JBoss5 shutdown
          clebert.suconic

           

          >>The problem is that your code does account for the case where FailoverCommandCenter == null (non clustered), but it's not a MessagingShutdownException


          on this case, the ConnectionConsumer will aways be closed... let me explain:

          The basic problem is, When JBAS is shutdown, case the handleClosing is not complete, the ConnectionConsumer will be waiting forever. So, during a shutdown we need to ensure ConnectionConsumer will finish

          handleClosing performs a client2server communication before calling clientConsumer.close():

          public Object handleClosing(Invocation invocation) throws Throwable
           {
          
          ......
           Long l = (Long) invocation.invokeNext(); <<<< --- this line will fail iif the server was killed...
          ....
           consumerState.getClientConsumer().close(lastDeliveryId); <<< -- if the server was killed, nothing will close the clientConsumer
          
          ....
          


          When you have failover in place, the above code is not a problem, as failover will take care of the exception reconnecting everything.


          But when you don't have a failover logic in place, nothing will close the consumer, what will cause a hang. That's why I aways close the consumer when you don't have a FailoverCommandCenter.

          1 2 Previous Next