Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2578

Two PrepareCommands in parallel cause ConcurrentModificationException

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 5.2.0.Final
    • 5.2.0.Final
    • None
    • None

      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.

              mircea.markus Mircea Markus (Inactive)
              rvansa1@redhat.com Radim Vansa (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: