Qpid
  1. Qpid
  2. QPID-3747

PrefetchBehaviourTest.testLowPrefetchCausesMessagesToBeDistributedBetweenConsumers occasionally fails on spawned profiles.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.15
    • Fix Version/s: 0.15
    • Component/s: Java Tests
    • Labels:
      None

      Description

      We see test AMQConnectionTest#testPrefetchSystemProperty occasionally fail on CI instances running the spawned profiles with assertion failure "Consumer A should not have received a 3rd message"

      e.g. java-mms-spawn.0-10

      junit.framework.AssertionFailedError: Consumer A should not have received a 3rd message
      	at org.apache.qpid.test.unit.client.AMQConnectionTest.testPrefetchSystemProperty(AMQConnectionTest.java:263)
      	at org.apache.qpid.test.utils.QpidBrokerTestCase.runBare(QpidBrokerTestCase.java:240)
      	at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:135)
      

        Activity

        Hide
        Keith Wall added a comment -

        Patch representing my work so far.

        Show
        Keith Wall added a comment - Patch representing my work so far.
        Hide
        Keith Wall added a comment -

        This seems to be a Java Broker bug affecting 0-10 only. When the problem occurs the incoming MessageTransfer for the third message always has the wrong destination, causing the message to be sent to the (wrong) Consumer A (destination 1) rather than Consumer B (destination 2).

        The failing case:

        main 2012-01-12 08:54:11,318 DEBUG [qpid.client.prefetch.PrefetchBehaviourTest] Checking that Consumer A does not have 3rd message
        main 2012-01-12 08:54:11,318 DEBUG [qpid.client.AMQSession.Dispatcher] Set Dispatcher Connection Started: Currently Started
        IoReceiver - localhost/127.0.0.1:15672 2012-01-12 08:54:11,318 DEBUG [apache.qpid.transport.Connection] RECV: [conn:34883357] ch=0 MessageTransfer(destinatio
        n=1, acceptMode=EXPLICIT, acquireMode=PRE_ACQUIRED)
          DeliveryProperties(priority=MEDIUM, deliveryMode=PERSISTENT, timestamp=1326358451231, exchange=amq.direct, routingKey=PrefetchBehaviourTest-testLowPrefetch
        CausesMessagesToBeDistributedBetweenConsumers)
          MessageProperties(contentLength=1024, messageId=63e1574b-d085-3e4e-aeb8-f5695bd0e849, contentType=text/plain, userId=[B@3b19e583, applicationHeaders={index
        =2})
        

        The successful case:

        
        main 2012-01-12 08:39:58,236 DEBUG [qpid.client.prefetch.PrefetchBehaviourTest] Checking that Consumer A does not have 3rd message
        main 2012-01-12 08:39:58,236 DEBUG [qpid.client.AMQSession.Dispatcher] Set Dispatcher Connection Started: Currently Started
        BROKER: pool-3-thread-5 2012-01-12 08:39:58,236 DEBUG [apache.qpid.transport.Connection] SEND: [conn:6ce931d9] ch=0 id=2 [B] MessageTransfer(destination=2, a
        cceptMode=EXPLICIT, acquireMode=PRE_ACQUIRED)
        BROKER:   DeliveryProperties(priority=MEDIUM, deliveryMode=PERSISTENT, timestamp=1326357598175, exchange=amq.direct, routingKey=PrefetchBehaviourTest-testLow
        PrefetchCausesMessagesToBeDistributedBetweenConsumers)
        BROKER:   MessageProperties(contentLength=1024, messageId=96258a94-f08d-3a56-9af4-94b04b5d2e70, contentType=text/plain, userId=[B@30cafa1, applicationHeaders
        ={index=2})
        
        
        
        Show
        Keith Wall added a comment - This seems to be a Java Broker bug affecting 0-10 only. When the problem occurs the incoming MessageTransfer for the third message always has the wrong destination, causing the message to be sent to the (wrong) Consumer A (destination 1) rather than Consumer B (destination 2). The failing case: main 2012-01-12 08:54:11,318 DEBUG [qpid.client.prefetch.PrefetchBehaviourTest] Checking that Consumer A does not have 3rd message main 2012-01-12 08:54:11,318 DEBUG [qpid.client.AMQSession.Dispatcher] Set Dispatcher Connection Started: Currently Started IoReceiver - localhost/127.0.0.1:15672 2012-01-12 08:54:11,318 DEBUG [apache.qpid.transport.Connection] RECV: [conn:34883357] ch=0 MessageTransfer(destinatio n=1, acceptMode=EXPLICIT, acquireMode=PRE_ACQUIRED) DeliveryProperties(priority=MEDIUM, deliveryMode=PERSISTENT, timestamp=1326358451231, exchange=amq.direct, routingKey=PrefetchBehaviourTest-testLowPrefetch CausesMessagesToBeDistributedBetweenConsumers) MessageProperties(contentLength=1024, messageId=63e1574b-d085-3e4e-aeb8-f5695bd0e849, contentType=text/plain, userId=[B@3b19e583, applicationHeaders={index =2}) The successful case: main 2012-01-12 08:39:58,236 DEBUG [qpid.client.prefetch.PrefetchBehaviourTest] Checking that Consumer A does not have 3rd message main 2012-01-12 08:39:58,236 DEBUG [qpid.client.AMQSession.Dispatcher] Set Dispatcher Connection Started: Currently Started BROKER: pool-3-thread-5 2012-01-12 08:39:58,236 DEBUG [apache.qpid.transport.Connection] SEND: [conn:6ce931d9] ch=0 id=2 [B] MessageTransfer(destination=2, a cceptMode=EXPLICIT, acquireMode=PRE_ACQUIRED) BROKER: DeliveryProperties(priority=MEDIUM, deliveryMode=PERSISTENT, timestamp=1326357598175, exchange=amq.direct, routingKey=PrefetchBehaviourTest-testLow PrefetchCausesMessagesToBeDistributedBetweenConsumers) BROKER: MessageProperties(contentLength=1024, messageId=96258a94-f08d-3a56-9af4-94b04b5d2e70, contentType=text/plain, userId=[B@30cafa1, applicationHeaders ={index=2})
        Hide
        Keith Wall added a comment -

        Test renamed from AMQConnectionTest#testPrefetchSystemProperty to PrefetchBehaviourTest.testLowPrefetchCausesMessagesToBeDistributedBetweenConsumers by QPID-3635

        Show
        Keith Wall added a comment - Test renamed from AMQConnectionTest#testPrefetchSystemProperty to PrefetchBehaviourTest.testLowPrefetchCausesMessagesToBeDistributedBetweenConsumers by QPID-3635
        Hide
        Keith Wall added a comment -

        Hi Robbie,

        Changes made as discussed, cheers, Keith.

        Show
        Keith Wall added a comment - Hi Robbie, Changes made as discussed, cheers, Keith.
        Hide
        Robbie Gemmell added a comment -

        Change looks good to me.

        Show
        Robbie Gemmell added a comment - Change looks good to me.

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Keith Wall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development