Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3466

IndexOutOfBounds in kahadb with large number of subscriptions and pending messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.5.0
    • 5.6.0
    • Broker
    • None

    Description

      When there are several durable subscribers each with a large number of pending messages to be acked the an error occurs, as well as some others involving ArrayIndexOutOfBoundsExceptions and NullPointerExceptions while reading or writing the chunk stream.

      javax.jms.JMSException: STORE COMMIT FAILED: Transaction rolled back.
      	at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
      	at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1287)
      	at org.apache.activemq.TransactionContext.syncSendPacketWithInterruptionHandling(TransactionContext.java:704)
      	at org.apache.activemq.TransactionContext.commit(TransactionContext.java:299)
      	at org.apache.activemq.ActiveMQSession.commit(ActiveMQSession.java:560)
      	at org.apache.activemq.process.TopicWithManySelectorsTest.sendNotification(TopicWithManySelectorsTest.java:126)
      	at org.apache.activemq.process.TopicWithManySelectorsTest.test(TopicWithManySelectorsTest.java:85)
      	at org.apache.activemq.process.TopicWithManySelectorsTest.testMass(TopicWithManySelectorsTest.java:42)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at junit.framework.TestCase.runTest(TestCase.java:168)
      	at junit.framework.TestCase.runBare(TestCase.java:134)
      	at org.apache.activemq.CombinationTestSupport.runBare(CombinationTestSupport.java:90)
      	at org.apache.activemq.CombinationTestSupport.runBare(CombinationTestSupport.java:96)
      	at junit.framework.TestResult$1.protect(TestResult.java:110)
      	at junit.framework.TestResult.runProtected(TestResult.java:128)
      	at junit.framework.TestResult.run(TestResult.java:113)
      	at junit.framework.TestCase.run(TestCase.java:124)
      	at junit.framework.TestSuite.runTest(TestSuite.java:232)
      	at junit.framework.TestSuite.run(TestSuite.java:227)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:94)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:196)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
      Caused by: javax.transaction.xa.XAException: STORE COMMIT FAILED: Transaction rolled back.
      	at org.apache.activemq.transaction.LocalTransaction.commit(LocalTransaction.java:77)
      	at org.apache.activemq.broker.TransactionBroker.commitTransaction(TransactionBroker.java:173)
      	at org.apache.activemq.broker.MutableBrokerFilter.commitTransaction(MutableBrokerFilter.java:103)
      	at org.apache.activemq.broker.TransportConnection.processCommitTransactionOnePhase(TransportConnection.java:424)
      	at org.apache.activemq.command.TransactionInfo.visit(TransactionInfo.java:100)
      	at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:311)
      	at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185)
      	at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
      	at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
      	at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:219)
      	at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
      	at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: javax.transaction.xa.XAException: POST COMMIT FAILED
      	at org.apache.activemq.transaction.Transaction.doPostCommit(Transaction.java:182)
      	at org.apache.activemq.transaction.Transaction$2.call(Transaction.java:54)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at org.apache.activemq.store.kahadb.MessageDatabase.store(MessageDatabase.java:768)
      	at org.apache.activemq.store.kahadb.KahaDBTransactionStore.commit(KahaDBTransactionStore.java:264)
      	at org.apache.activemq.transaction.LocalTransaction.commit(LocalTransaction.java:72)
      	... 14 more
      Caused by: java.lang.ArrayIndexOutOfBoundsException
      	at java.lang.System.arraycopy(Native Method)
      	at org.apache.kahadb.page.Transaction$2.read(Transaction.java:494)
      	at java.io.DataInputStream.readFully(DataInputStream.java:178)
      	at java.io.DataInputStream.readFully(DataInputStream.java:152)
      	at org.apache.activemq.store.kahadb.MessageDatabase$HashSetStringMarshaller.readPayload(MessageDatabase.java:2352)
      	at org.apache.activemq.store.kahadb.MessageDatabase$HashSetStringMarshaller.readPayload(MessageDatabase.java:2335)
      	at org.apache.kahadb.index.BTreeNode$Marshaller.readPayload(BTreeNode.java:201)
      	at org.apache.kahadb.index.BTreeNode$Marshaller.readPayload(BTreeNode.java:147)
      	at org.apache.kahadb.page.Transaction.load(Transaction.java:406)
      	at org.apache.kahadb.page.Transaction.load(Transaction.java:361)
      	at org.apache.kahadb.index.BTreeIndex.loadNode(BTreeIndex.java:262)
      	at org.apache.kahadb.index.BTreeNode.getChild(BTreeNode.java:225)
      	at org.apache.kahadb.index.BTreeNode.getLeafNode(BTreeNode.java:672)
      	at org.apache.kahadb.index.BTreeNode.get(BTreeNode.java:558)
      	at org.apache.kahadb.index.BTreeIndex.get(BTreeIndex.java:184)
      	at org.apache.activemq.store.kahadb.MessageDatabase.removeAckLocation(MessageDatabase.java:1642)
      	at org.apache.activemq.store.kahadb.MessageDatabase.updateIndex(MessageDatabase.java:1051)
      	at org.apache.activemq.store.kahadb.MessageDatabase$15.execute(MessageDatabase.java:890)
      	at org.apache.kahadb.page.Transaction.execute(Transaction.java:728)
      	at org.apache.activemq.store.kahadb.MessageDatabase.process(MessageDatabase.java:888)
      	at org.apache.activemq.store.kahadb.MessageDatabase$13.visit(MessageDatabase.java:833)
      	at org.apache.activemq.store.kahadb.data.KahaRemoveMessageCommand.visit(KahaRemoveMessageCommand.java:220)
      	at org.apache.activemq.store.kahadb.MessageDatabase.process(MessageDatabase.java:825)
      	at org.apache.activemq.store.kahadb.MessageDatabase.store(MessageDatabase.java:751)
      	at org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore.doAcknowledge(KahaDBStore.java:650)
      	at org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore.acknowledge(KahaDBStore.java:637)
      	at org.apache.activemq.store.ProxyTopicMessageStore.acknowledge(ProxyTopicMessageStore.java:78)
      	at org.apache.activemq.broker.region.Topic.acknowledge(Topic.java:505)
      	at org.apache.activemq.broker.region.DurableTopicSubscription.unmatched(DurableTopicSubscription.java:85)
      	at org.apache.activemq.broker.region.policy.SimpleDispatchPolicy.dispatch(SimpleDispatchPolicy.java:44)
      	at org.apache.activemq.broker.region.Topic.dispatch(Topic.java:628)
      	at org.apache.activemq.broker.region.Topic$4.afterCommit(Topic.java:466)
      	at org.apache.activemq.transaction.Transaction.fireAfterCommit(Transaction.java:109)
      	at org.apache.activemq.transaction.Transaction.doPostCommit(Transaction.java:177)
      	... 20 more
      

      Attachments

        Activity

          People

            gtully Gary Tully
            tabish Timothy A. Bish
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: