You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Victor Rubezhny (Jira)" <ji...@apache.org> on 2021/05/06 13:02:00 UTC

[jira] [Created] (MINDEXER-127) Maven repository indexing error: java.nio.channels.OverlappingFileLockException

Victor Rubezhny created MINDEXER-127:
----------------------------------------

             Summary: Maven repository indexing error: java.nio.channels.OverlappingFileLockException
                 Key: MINDEXER-127
                 URL: https://issues.apache.org/jira/browse/MINDEXER-127
             Project: Maven Indexer
          Issue Type: Bug
    Affects Versions: 6.0.0
            Reporter: Victor Rubezhny


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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)