[infinispan-issues] [JBoss JIRA] (ISPN-2578) Two PrepareCommands in parallel cause ConcurrentModificationException

RH Bugzilla Integration (JIRA) jira-events at lists.jboss.org
Mon Dec 3 10:13:21 EST 2012


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

RH Bugzilla Integration commented on ISPN-2578:
-----------------------------------------------

Radim Vansa <rvansa at redhat.com> made a comment on [bug 882990|https://bugzilla.redhat.com/show_bug.cgi?id=882990]

Situation:
1) Node A broadcasts PrepareCommand to nodes B, C
2) Node A leaves cluster, causing new topology to be installed
3) The command arrives to B and C, with lower topology than the current one
4) Both B and C forward the command to node D
5) D executes the two commands in parallel and finds out that A has left, therefore executing RollbackCommand

In AbstractTxLockingInterceptor.visitRollbackCommand we call LockManagerImpl.unlockAll which iterates over the keys and unlocks them. As these two prepares aren't synchronized over the lockedKeys set, one may unlock and remove these keys while the other is iterating through them, causing ConcurrentModificationException.
                
> Two PrepareCommands in parallel cause ConcurrentModificationException
> ---------------------------------------------------------------------
>
>                 Key: ISPN-2578
>                 URL: https://issues.jboss.org/browse/ISPN-2578
>             Project: Infinispan
>          Issue Type: Bug
>            Reporter: Radim Vansa
>            Assignee: Mircea Markus
>
> Situation:
> 1) Node A broadcasts PrepareCommand to nodes B, C
> 2) Node A leaves cluster, causing new topology to be installed
> 3) The command arrives to B and C, with lower topology than the current one
> 4) Both B and C forward the command to node D
> 5) D executes the two commands in parallel and finds out that A has left, therefore executing RollbackCommand
> In {{AbstractTxLockingInterceptor.visitRollbackCommand}} we call {{LockManagerImpl.unlockAll}} which iterates over the keys and unlocks them. As these two prepares aren't synchronized over the {{lockedKeys}} set, one may unlock and remove these keys while the other is iterating through them, causing {{ConcurrentModificationException}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list