[jboss-jira] [JBoss JIRA] (JGRP-1383) ConcurrentModificationException in BasicConnectionTable.retainAll

Dennis Reed (Commented) (JIRA) jira-events at lists.jboss.org
Wed Dec 7 11:08:41 EST 2011


    [ https://issues.jboss.org/browse/JGRP-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648904#comment-12648904 ] 

Dennis Reed commented on JGRP-1383:
-----------------------------------

The patch already in 2.6.21 covers this other use case, since it makes a private copy of the set inside a synchronized block before passing it to BasicConnectionTable.
(The symptoms were completely different than the original, so I wanted to document the new symptoms).

It looks like master should be ok also, since BasicTCP#handleDownEvent is already sending a private copy of the set as a side effect of looking up the physical addresses.

                
> ConcurrentModificationException in BasicConnectionTable.retainAll
> -----------------------------------------------------------------
>
>                 Key: JGRP-1383
>                 URL: https://issues.jboss.org/browse/JGRP-1383
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 2.6.20
>            Reporter: Dennis Reed
>            Assignee: Dennis Reed
>             Fix For: 2.6.21
>
>         Attachments: JGRP-1383-test.tgz
>
>
> java.util.ConcurrentModificationException
> 	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
> 	at java.util.HashMap$KeyIterator.next(HashMap.java:828)
> 	at java.util.AbstractSet.removeAll(AbstractSet.java:154)
> 	at org.jgroups.blocks.BasicConnectionTable.retainAll(BasicConnectionTable.java:344)
> 	at org.jgroups.protocols.TCP.retainAll(TCP.java:59)
> 	at org.jgroups.protocols.BasicTCP.handleDownEvent(BasicTCP.java:265)
> 	at org.jgroups.protocols.TP.down(TP.java:1145)
>         ...
> BasicTCP is missing a synchoronize on "members" when it passes it to TCP.retainAll.
> If members is modified by another thread (in TP.handleDownEvent) while BasicConnectionTable's Set.removeAll
> call is iterating over it, it triggers a ConcurrentModificationException.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list