You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Jayson Minard (JIRA)" <ji...@apache.org> on 2008/10/13 08:56:52 UTC

[jira] Updated: (AMQ-1971) ConcurrentModificationException in high volume broker

     [ https://issues.apache.org/activemq/browse/AMQ-1971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jayson Minard updated AMQ-1971:
-------------------------------

    Attachment: amq1971.patch

I have a tested patch for the ConcurrentModificationException in AMQ-1971, this also uncovered a bug with a related class.  See below:

Patch to fix ConcurrentModificationException which is caused by not having a perfectly synchronized this.iterator and this.batchList in AbstractStoreCursor.  Also removed any access to these member variables from subclasses to ensure they are synchronized and make sure they are not manipulated seperately.  This caused a small change in TopicStorePrefetch which had a reference to batchList although it actually overrode the ancestor class which meant that its remove() method never actually worked.  So that was replaced with a call to AbstractSoreCursor to do the actual remove work.  A few TODO comments are left in the patch for review by someone that knows more.

Basically, the fix is to ensure that all changes to batchList cause a release of the cached iterator.

> ConcurrentModificationException in high volume broker 
> ------------------------------------------------------
>
>                 Key: AMQ-1971
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1971
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>            Reporter: Jayson Minard
>            Assignee: Rob Davies
>         Attachments: amq1971.patch
>
>
> This is occurring in the thousands as messages come through.    We have a network of 5 brokers although they do most of their work internally (publisher/consumer for queue are only on same broker) and do less work crossing to a central broker.
> java.util.ConcurrentModificationException
> 	at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:373)
> 	at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:392)
> 	at java.util.LinkedHashMap$EntryIterator.next(LinkedHashMap.java:391)
> 	at org.apache.activemq.broker.region.cursors.AbstractStoreCursor.next(AbstractStoreCursor.java:136)
> 	at org.apache.activemq.broker.region.cursors.StoreQueueCursor.next(StoreQueueCursor.java:140)
> 	at org.apache.activemq.broker.region.Queue.doPageIn(Queue.java:1178)
> 	at org.apache.activemq.broker.region.Queue.pageInMessages(Queue.java:1290)
> 	at org.apache.activemq.broker.region.Queue.iterate(Queue.java:1004)
> 	at org.apache.activemq.thread.DeterministicTaskRunner.runTask(DeterministicTaskRunner.java:84)
> 	at org.apache.activemq.thread.DeterministicTaskRunner$1.run(DeterministicTaskRunner.java:41)
> 	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:619)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.