Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63118

Maven Projects don't delete temp 'resource-xxx' directories from /tmp

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • core, maven-plugin, remoting
    • Jenkins ver. 2.190.2 on Ubuntu Linux 64-bit
      os.version = 4.4.0-177-generic
      openjdk-8 (1.8.0_232)

    Description

      We've noticed that the /tmp directory on our slaves is filling up with directories with names beginning with "resource-" (ex. "resource-504258138138001911").

      I was able to narrow down how to reproduce the issue.  Most of our jobs are "Freestyle" projects, but one is a "Maven Project"; and whenever that job runs, it creates a /tmp/resources-xxx temp directory but never deletes it.  The Freestyle projects that run the exact same "mvn clean install" command using the Execute shell plugin don't experience this issue.

      If you want to reproduce it, create a Maven Project, clone a git repo that has a maven project that has some JUnit tests.  Run "ls -al /tmp" before and after executing the "clean install" maven goal.  You will see 2 new /tmp/resource directories after running the Maven goal (which should also run some tests).

       

      My guess as to the problem is someone is probably calling Files.createTempDirectory("resource-") without calling File.deleteOnExit() afterwards.

      Attachments

        Activity

          cpjust Chris Just created issue -
          cpjust Chris Just made changes -
          Field Original Value New Value
          Description We've noticed that the /tmp directory on our slaves is filling up with directories with names beginning with "resource-" (ex. "resource-504258138138001911").

          I was able to narrow down how to reproduce the issue.  Most of our jobs are "Freestyle" projects, but one is a "Maven Project"; and whenever that job runs, it creates a /tmp/resources-xxx temp directory but never deletes it.  The Freestyle projects that run the exact same "mvn clean install" command using the Execute shell plugin don't experience this issue.

          If you want to reproduce it, create a Maven Project, clone a git repo that has a maven project that has some JUnit tests.  Run "ls -al /tmp" before and after executing the "clean install" maven goal.  You will see 2 new /tmp/resource directories after running the Maven goal (which should also run some tests).
          We've noticed that the /tmp directory on our slaves is filling up with directories with names beginning with "resource-" (ex. "resource-504258138138001911").

          I was able to narrow down how to reproduce the issue.  Most of our jobs are "Freestyle" projects, but one is a "Maven Project"; and whenever that job runs, it creates a /tmp/resources-xxx temp directory but never deletes it.  The Freestyle projects that run the exact same "mvn clean install" command using the Execute shell plugin don't experience this issue.

          If you want to reproduce it, create a Maven Project, clone a git repo that has a maven project that has some JUnit tests.  Run "ls -al /tmp" before and after executing the "clean install" maven goal.  You will see 2 new /tmp/resource directories after running the Maven goal (which should also run some tests).

           

          My guess as to the problem is someone is probably calling [Files.createTempDirectory("resource-")|[https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#createTempDirectory-java.nio.file.Path-java.lang.String-java.nio.file.attribute.FileAttribute...-]] without calling File.deleteOnExit() afterwards.
          oleg_nenashev Oleg Nenashev made changes -
          Component/s maven-plugin [ 16033 ]
          tom_gl Thomas de Grenier de Latour made changes -
          Component/s remoting [ 15489 ]

          People

            Unassigned Unassigned
            cpjust Chris Just
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: