Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-27318

Maven - Publish Maven Indexer files task leaks inputstream

    XMLWordPrintable

    Details

    • Notability:
      3

      Description

      NXRM 3 depends on

      <dependency>
      <groupId>org.apache.maven.indexer</groupId>
      <artifactId>indexer-reader</artifactId>
      <version>5.1.2-816025a</version>
      <type>bundle</type>
      </dependency>

      This dependency has a known inputstream leak:

      https://issues.apache.org/jira/browse/MINDEXER-121

      NXRM 3 code calls the iterator, which will lead to the resource leak:

      https://github.com/sonatype/nexus-public/blob/master/plugins/nexus-repository-maven/src/main/java/org/sonatype/nexus/repository/maven/internal/MavenIndexPublisher.java#L119:L120

      IndexReader indexReader = closer.register(new IndexReader(null, resourceHandler));
      ChunkReader chunkReader = closer.register(indexReader.iterator().next());
      

      In instances that are executing the index publish task on a regular basis, eventually NXRM process may report errors such as

      "java.io.IOException: Too many open files"

      on *.bytes in the blobstores of the repositories where the task is configured to run.

      A sure sign of this is consistently growing lsof output showing linearly growing numbers of open files per execution of the index publish task.

      Restarting NXRM process is the only remedy to clear these leaks if the tasks must be run. Otherwise stop using the task. Do you really need it?

      Expected

      Protect against the file leak.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Michael Oliverio Michael Oliverio
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title