Uploaded image for project: 'ActiveMQ C++ Client'
  1. ActiveMQ C++ Client
  2. AMQCPP-384

Failover and prefetch=0 can result in hung consumers if the MessagePull command is lost

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • None
    • None
    • Patch Available

    Description

      The problem has been fixed in ActiveMQ Java Client with the issue AMQ-2877:
      https://issues.apache.org/jira/browse/AMQ-2877

      I've attached a patch that backport the fix done in java to C++. It can be probably used as suggestion...

      With prefetch=0, a consumer that has no messages sends an async message to the broker to have it dispatch a single message and waits for the dispatch to ocurr. prefetch=0 makes the consumer a pull consumer, in that it has to ask for a message each time.

      there is a possibility that failover occurs just after the send of the messagePull command such that the consumer is blocked waiting for a message but a failover connection or broker does not know about the outstanding pull command. The connection state tracker is the normal mechanism for command replay after failover. This needs to be extended to track messagePull commands, keeping one outstanding reference for each consumer/destination pair that can be replayed after failover.
      It makes sense to reuse the messageCache for this.

      Attachments

        1. ConnectionStateTracker.cpp.diff
          3 kB
          Daniel Laügt
        2. ConnectionStateTracker.h.diff
          1 kB
          Daniel Laügt

        Activity

          People

            tabish Timothy A. Bish
            dlaugt Daniel Laügt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: