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

Deadlock in TarWriter

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      There is the potential for a deadlock between concurrent calls to TarWriter#createNextGeneration() and TarWriter#flush(): both methods try to acquire a lock on this and another lock on TarWriter.file but in different order. I observed the deadlock when running CompactionAndCleanupIT.randomAccessFileConcurrentReadAndLength().

      This is a regression introduced with OAK-4746: the method TarWriter.createNextGeneration() seems over eagerly synchronized. I would argue that we could drop synchronization for that method entirely as the part after the call to close() will in any case only ever be executed once by a single thread. All other threads will fail with an IllegalStateException).

      Alexandru Parvulescu, WDYT?

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              stillalex Alex Deparvu
              Reporter:
              mduerig Michael Dürig

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment