Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-1101

DestNameExchange uses shallow copy of queues for routing, causing routing to fail if queueDeleted.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • M2, M2.1
    • M4
    • Broker-J
    • None

    Description

      Summary:
      When testing with the BDBStore module it was noted that on occasion a mesage would be enqueued on a queue but the Metadata was not in the DB.

      This is due to the the fact that when routing takes place a shallow copy of queues the message has been enqueued to is returned by the DestNameExchange. If the queue is deleted before the message can be routed then it is removed from the list and never routed. This results in the message being purged from the DB but the enqueued reference remaining.

      The solution is to make a deep copy so that the DestNameExchange can modify the list without affecting routing.

      Steps to Reproduce:
      This is a race condition so can be difficult but:
      Using the broker with the BDBStore Module.

      Set up a client that reads from queue1 and replies to the JMSReplyTo.

      Set up client2 that reads from a tempQueue.

      Use client2 to send two messages (with tempQueue as the replyTo) to queue1

      When you receive message 1 on client2 close the consumer

      If this is running inVM then the consumer close should occur as message 2 is routing.

      Restart the broker and it should fail to start with a MetaData not found for message 5 error.

      Defect Identification:
      As above, the shallow copy of enqueued queues is being modifed during routing.

      Proposed Changes:
      Make a copy of the list
      Swap this:
      payload.enqueue(queues);
      to
      payload.enqueue(new ArrayList<AMQQueue>(queues));

      Test Strategy:
      QueueDeleteRouteTest to be provided

      This must be done on trunk then back merged.
      Difficulties exist as the trunk now uses QpidTestCase which is not capable of running multiple InVM brokers

      Attachments

        Issue Links

          Activity

            People

              aidan Aidan Skinner
              ritchiem Martin Ritchie
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified