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

Double unlock during rollback breaks reference counting

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: Critical Critical
    • 5.2.0.Final
    • 5.2.0.Final
    • Transactions
    • None

      Using pessimistic locking, when a transaction is rolled-back, RollbackCommand and then TxCompletionNotification commands are sent to the primary owner. When the order of these two changes, the locks are unlocked twice: first by TxCompletionNotification calling LockManagerImpl.unlock(Collection<Object> lockedKeys, Object lockOwner) and then by AbstractTxLockingInterceptor.visitRollbackCommand calling LockManagerImpl.unlockAll(...)

      When the lock is acquired after the first unlock, the second unlock fails with IllegalMonitorStateException in OwnableReentrantLock.tryAcquire(...), but the reference count is still decremented in AbstractPerEntryLockContainer.releaseLock(...). This results in further IllegalStateException: Negative reference count for lock

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

                Created:
                Updated:
                Resolved:
                Archived: