ActiveMQ
  1. ActiveMQ
  2. AMQ-1251

Broker stops delivering messages to some consumers

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.0
    • Fix Version/s: 5.0.0
    • Component/s: Broker
    • Labels:
      None
    • Environment:

      WinXP

      Description

      I have around 40 consumers taking messages from a single queue. After awhile 1 or 2 consumers stop receiveing any messages. Going to JMX and stopping corresponding connection causes re-connect and messages are delivered again.

      I reproduced it twice in QA enviroment and now it happened in production. I tried to instrument the code and set the log in debug, but that changed timing and I failed to reproduce it after the changes.

      I suspect that runtime association b/w Queue and Consumer objects is lost on the Broker side.

      One of the suspects is the empty catch block in the RoundRobinDispatchPolicy (line 64) class. It is possible that the CopyOnWrite array list is messed up and it fails when removed consumer is added back.

      BTW CopyOnWrite list is good when you mostly read, but not so good when you write for every message delivery and empty catch blocks are bad in any case.

      if (firstMatchingConsumer != null) {
      // Rotate the consumer list.
      try

      { consumers.remove(firstMatchingConsumer); consumers.add(firstMatchingConsumer); }

      catch (Throwable bestEffort) {
      }
      }

      1. QueueWorkerPrefetchTest.java
        8 kB
        Hiram Chirino
      2. TestActiveMQ.java
        7 kB
        David Sitsky
      3. TestActiveMQSyncReceive.java
        8 kB
        David Sitsky

        Activity

        Vadim Pesochinskiy created issue -
        Rob Davies made changes -
        Field Original Value New Value
        Assignee Rob Davies [ rajdavies ]
        Rob Davies made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        David Sitsky made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        David Sitsky made changes -
        Attachment TestActiveMQ.java [ 15700 ]
        David Sitsky made changes -
        Attachment TestActiveMQSyncReceive.java [ 15716 ]
        Hiram Chirino made changes -
        Attachment QueueWorkerPrefetchTest.java [ 15723 ]
        Rob Davies made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Jeff Turner made changes -
        Project Import Fri Nov 26 22:32:02 EST 2010 [ 1290828722158 ]

          People

          • Assignee:
            Rob Davies
            Reporter:
            Vadim Pesochinskiy
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development