Qpid
  1. Qpid
  2. QPID-4092

org.apache.qpid.server.queue.AMQPriorityQueueTest.testPriorityOrdering failed on Qpid-Java-Java-Test-IBMJDK1.6 Apache Jenkins CI job

    Details

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

      Description

      We saw test AMQPriorityQueueTest.testPriorityOrdering fail in build 133 with the following exception on the Qpid-Java-Java-Test-IBMJDK1.6 job profile.

      https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-Java-Java-Test-IBMJDK1.6/133/testReport/junit/org.apache.qpid.server.queue/AMQPriorityQueueTest/testPriorityOrdering/

      org.apache.qpid.server.queue.AMQPriorityQueueTest.testPriorityOrdering
      
      Failing for the past 1 build (Since #133 )
      Took 0.17 sec.
      Error Message
      
      Index: 0, Size: 0
      Stacktrace
      
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.get(ArrayList.java:343)
      	at org.apache.qpid.server.queue.AMQPriorityQueueTest.testPriorityOrdering(AMQPriorityQueueTest.java:69)
      	at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:137)
      
      

      It also appears the delivery thread failed with a NPE:

      Exception in thread "pool-3-thread-49" java.util.concurrent.RejectedExecutionException
      	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1770)
      	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:778)
      	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:669)
      	at org.apache.qpid.server.queue.SimpleAMQQueue.execute(SimpleAMQQueue.java:305)
      	at org.apache.qpid.server.queue.QueueRunner.run(QueueRunner.java:100)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:896)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      	at java.lang.Thread.run(Thread.java:735)
      Exception in thread "pool-3-thread-67" java.lang.NullPointerException
      	at org.apache.qpid.server.queue.SimpleAMQQueue.setLastSeenEntry(SimpleAMQQueue.java:836)
      	at org.apache.qpid.server.queue.SimpleAMQQueue.deliverMessage(SimpleAMQQueue.java:819)
      	at org.apache.qpid.server.queue.SimpleAMQQueue.attemptDelivery(SimpleAMQQueue.java:1843)
      	at org.apache.qpid.server.queue.SimpleAMQQueue.processQueue(SimpleAMQQueue.java:2010)
      	at org.apache.qpid.server.queue.QueueRunner.run(QueueRunner.java:71)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:896)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      	at java.lang.Thread.run(Thread.java:735)
      

        Activity

        Hide
        Robbie Gemmell added a comment -

        Looks like SimpleAMQQueue.java:836 needs a null check, it appears to be the only place the Subscription QueueContext is used without a null check being performed, leaving a race when the Subscription is unregistered (at which point the context is set null) and the LastSeen entry is being set on it.

        Show
        Robbie Gemmell added a comment - Looks like SimpleAMQQueue.java:836 needs a null check, it appears to be the only place the Subscription QueueContext is used without a null check being performed, leaving a race when the Subscription is unregistered (at which point the context is set null) and the LastSeen entry is being set on it.
        Hide
        Robbie Gemmell added a comment -

        We should probably also be catching those RejectedExecutionExceptions

        Show
        Robbie Gemmell added a comment - We should probably also be catching those RejectedExecutionExceptions
        Hide
        Keith Wall added a comment - - edited

        Patch applied, Robbie could you please review?

        Grrr.. I'm sorry, I typo'd the commit message and used QPID-4902. It is rev 1355721.

        Show
        Keith Wall added a comment - - edited Patch applied, Robbie could you please review? Grrr.. I'm sorry, I typo'd the commit message and used QPID-4902 . It is rev 1355721.
        Hide
        Robbie Gemmell added a comment -

        Looks ok to me.

        Show
        Robbie Gemmell added a comment - Looks ok to me.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development