Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-2866

Cluster: Node type register/unregister deadlock

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.2
    • Component/s: clustering
    • Labels:
      None

      Description

      A deadlock can occur when two cluster nodes concurrently register or unregister node types.

      Reason:

      NodeTypeRegistry.registerNodeTypes is synchronized, and calls eventChannel.registered(ntDefs), which calls AbstractJournal.lockAndSync(), which tries to lock AbstractJournal.rwLock.

      On the other hand, AbstractJournal.sync() locks AbstractJournal.rwLock, then calls NodeTypeRecord.process, which calls NodeTypeRegistry.unregisterNodeTypes, which is also synchronized.

      Possible solutions: Either

      • NodeTypeRegistry doesn't synchronize on the object when calling a eventChannel method,
      • or NodeTypeRegistry locks AbstractJournal.rwLock before synchronizing.

      There might be other solutions.

        Attachments

        1. jcr-2866-a.patch
          13 kB
          Thomas Mueller

          Issue Links

            Activity

              People

              • Assignee:
                thomasm Thomas Mueller
                Reporter:
                thomasm Thomas Mueller
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: