Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-2772

ActiveMQConnectionConsumer will break failover

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.3.2
    • 5.4.0
    • Connector
    • None

    Description

      ActiveMQConnection.transportInterupted assumes that
      dispatchers.size() == all session's consumers + one advisoryConsumer

      But ActiveMQConnectionConsumer also registers itself as dispatcher in constructor.

      On failover attempt connection will remain in waiting state.
      Logging "dispatch paused, waiting for outstanding dispatch interruption processing (1) to complete.."

      ActiveMQConnectionConsumer is used in ActiveMQ resource adapter in ActiveMQEndpointWorker.

      Robust fix:

       
      Index: trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
      ===================================================================
      --- trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
      +++ trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
      @@ -1840,7 +1840,7 @@
       	}
       
           public void transportInterupted() {
      -        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0));
      +        transportInterruptionProcessingComplete = new CountDownLatch(dispatchers.size() - (advisoryConsumer != null ? 1:0) - connectionConsumers.size());
               if (LOG.isDebugEnabled()) {
                   LOG.debug("transport interrupted, dispatchers: " + transportInterruptionProcessingComplete.getCount());
               }
      

      Attachments

        Activity

          People

            gtully Gary Tully
            siim_kaalep Siim Kaalep
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: