Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4687

Issue with backgroundOperationLock handling in exception case

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.16, 1.6.0
    • Component/s: documentmk
    • Labels:
      None

      Description

      If in a commit some exception occurs then that exception gets hidden due to error in exception handling code path in DocumentNodeStore

      Instead of original exception following exception is seen

      Caused by: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread
      	at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.unmatchedUnlockException(ReentrantReadWriteLock.java:447)
      	at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:431)
      	at java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1340)
      	at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:883)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.canceled(DocumentNodeStore.java:767)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:303)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:268)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.access$300(DocumentNodeStoreBranch.java:58)
      	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch$InMemory.merge(DocumentNodeStoreBranch.java:513)
      	... 36 more
      

      This happens because the lock is released twice

      1. Once in DocumentNodeStore#done
      2. Second in DocumentNodeStore#canceled. Invoked in case of failure in DocumentNodeStoreBranch#persist

        Attachments

          Activity

            People

            • Assignee:
              mreutegg Marcel Reutegger
              Reporter:
              chetanm Chetan Mehrotra
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: