3 Replies Latest reply on Feb 18, 2015 1:17 PM by arothian

    MessageConsumer.receive(xxx) blocks indefinitely during failure situations.

    arothian

      Hi everyone,

       

      I'm encountering the issue described in [HORNETQ-1428] HornetQMessageConsumer.receive() ignores timeout - JBoss Issue Tracker.

       

      I have a hornetq server running within JBoss EAP 6.3.0.GA. This is hornetq version 2.3.20. Using remote lookups, I have consumers running in separate JVM that use the exported RemoteConnectionFactory within jboss. This connects fine, but then I kill the jboss server (and thereby hornetq server). Since I have retry configured on the connection factories, I see the log messages in debug output the hornetq client trying to re-connect to the now unavailable hornetq server. My consumer threads, however, are now all blocked in receive calls from a call to wait with Long.MAX_VALUE. I then startup the jboss server and the hornetq clients all reconnect successfully. My exception listeners are called and show that we failed over and the connections were automatically reconnected. However, the consumer threads are still blocked. It appears that nothing notifies them to unblock and only a restart will allow them keep consuming after a hornetq server failover. It's worth noting that these queues are empty while I'm doing this, so perhaps that impacts the timeliness of the notify to unblock the consumer threads; regardless, it seems that the threads should be notified so that they can adhere to the JMS specification regarding MessageConsumer.receive(long) not be blocking indefinitely.

       

      The indefinite wait is a little odd, but I think the issue here is that these threads aren't being notified to wake up after the re connection occurs?

       

      Let me know what information might be helpful, or if there is additional configuration that would resolve this.

       

      ConnectionFactory settings:

      {code}

                          <connection-factory name="RemoteConnectionFactory">

                              <connectors>

                                  <connector-ref connector-name="netty"/>

                              </connectors>

                              <entries>

                                  <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>

                              </entries>

                              <retry-interval>1000</retry-interval>

                              <retry-interval-multiplier>1.0</retry-interval-multiplier>

                              <reconnect-attempts>-1</reconnect-attempts>

                              <consumer-window-size>0</consumer-window-size>

                          </connection-factory>

      {code}