Uploaded image for project: 'Maven Indexer'
  1. Maven Indexer
  2. MINDEXER-127

Maven repository indexing error: java.nio.channels.OverlappingFileLockException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.0.0
    • 6.1.0, 6.1.1
    • None

    Description

      The `openAndWarmup()` method is invoked twice from `purge()` method of `org.apache.maven.index.context.DefaultIndexingContext` which results into `OverlappingFileLockException` during the index re-indexing, because the `openAndWarmup()` method call creates a `FileLock` for an index and the second call tries to create and add the second `FileLock` for the same index which is erroneous:

      ```
      java.nio.channels.OverlappingFileLockException
      at java.base/sun.nio.ch.FileLockTable.checkList(FileLockTable.java:229)
      at java.base/sun.nio.ch.FileLockTable.add(FileLockTable.java:123)
      at java.base/sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1154)
      at java.base/java.nio.channels.FileChannel.tryLock(FileChannel.java:1165)
      at org.apache.maven.index.context.DefaultIndexingContext.unlockForcibly(DefaultIndexingContext.java:927)
      at org.apache.maven.index.context.DefaultIndexingContext.prepareIndex(DefaultIndexingContext.java:244)
      at org.apache.maven.index.context.DefaultIndexingContext.purge(DefaultIndexingContext.java:612)
      at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.purgeCurrentIndex(NexusIndexManager.java:529)
      at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.reindexWorkspace(NexusIndexManager.java:561)
      at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.updateIndex(NexusIndexManager.java:1072)
      at org.eclipse.m2e.core.internal.index.nexus.NexusIndex.updateIndex(NexusIndex.java:147)
      at org.eclipse.m2e.core.ui.internal.preferences.MavenSettingsPreferencePage$2.runInWorkspace(MavenSettingsPreferencePage.java:263)
      at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
      ```

      The referencing issue is reported at: https://github.com/eclipse-m2e/m2e-core/issues/169

      Attachments

        Activity

          People

            slachiewicz Sylwester Lachiewicz
            vrubezhny Victor Rubezhny
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: