• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • jenkins 1.5.18; debian squeeze; jenkins package

      When fingerprinting large projects, jenkins fails with the following error message:

      Recording fingerprints
      ERROR: Failed to record fingerprints
      hudson.util.IOException2: Failed to compute digest for /var/lib/jenkins/workspace/zetbox-develop-Linux-Build-3-0/packages/NHibernate-dasz.3.3.3-DASZ2/src/Cfg/MappingSchema/HbmProperty.cs
      	at hudson.tasks.Fingerprinter$2.invoke(Fingerprinter.java:243)
      	at hudson.tasks.Fingerprinter$2.invoke(Fingerprinter.java:225)
      	at hudson.FilePath.act(FilePath.java:905)
      	at hudson.FilePath.act(FilePath.java:878)
      	at hudson.tasks.Fingerprinter.record(Fingerprinter.java:225)
      	at hudson.tasks.Fingerprinter.perform(Fingerprinter.java:121)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
      	at hudson.model.Run.execute(Run.java:1601)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:241)
      Caused by: java.io.FileNotFoundException: /var/lib/jenkins/workspace/zetbox-develop-Linux-Build-3-0/packages/NHibernate-dasz.3.3.3-DASZ2/src/Cfg/MappingSchema/HbmProperty.cs (Too many open files)
      	at java.io.FileInputStream.open(Native Method)
      	at java.io.FileInputStream.<init>(FileInputStream.java:137)
      	at hudson.FilePath$30.invoke(FilePath.java:1667)
      	at hudson.FilePath$30.invoke(FilePath.java:1664)
      	at hudson.FilePath.act(FilePath.java:905)
      	at hudson.FilePath.act(FilePath.java:878)
      	at hudson.FilePath.digest(FilePath.java:1664)
      	at hudson.tasks.Fingerprinter$2.invoke(Fingerprinter.java:241)
      	... 14 more
      Build step 'Record fingerprints of files to track usage' changed build result to FAILURE
      Finished: FAILURE
      

          [JENKINS-18351] Fingerprinting seems to leak Files

          David Schmitt created issue -
          kutzi made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: fingerprint [ 16622 ]
          Assignee Original: Marc Sanfacon [ marcsanfacon ] New: kutzi [ kutzi ]

          kutzi added a comment -

          Yeah, looks like you're right. FilePath#digest opens a new FileInputstream but never closes it explicitly
          https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/FilePath.java#L1663

          kutzi added a comment - Yeah, looks like you're right. FilePath#digest opens a new FileInputstream but never closes it explicitly https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/FilePath.java#L1663

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/93c31be1b75940dfd2e8a3c5954a4d57f4c8e6d5
          Log:
          [FIXED JENKINS-18351] file descriptor leak while fingerprinting

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/93c31be1b75940dfd2e8a3c5954a4d57f4c8e6d5 Log: [FIXED JENKINS-18351] file descriptor leak while fingerprinting
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Jesse Glick added a comment -

          Presumably caused by https://github.com/jenkinsci/jenkins/commit/9d72311ba0222b9d0489605b8ec2cec711690993 though I am not sure how; Util.getDigestOf seems to close its parameter, and BufferedInputStream seems to close its delegate when it itself is closed.

          Jesse Glick added a comment - Presumably caused by https://github.com/jenkinsci/jenkins/commit/9d72311ba0222b9d0489605b8ec2cec711690993 though I am not sure how; Util.getDigestOf seems to close its parameter, and BufferedInputStream seems to close its delegate when it itself is closed.
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-16301 [ JENKINS-16301 ]

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2610
          [FIXED JENKINS-18351] file descriptor leak while fingerprinting (Revision 93c31be1b75940dfd2e8a3c5954a4d57f4c8e6d5)

          Result = SUCCESS
          Christoph Kutzinski : 93c31be1b75940dfd2e8a3c5954a4d57f4c8e6d5
          Files :

          • changelog.html
          • core/src/main/java/hudson/FilePath.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2610 [FIXED JENKINS-18351] file descriptor leak while fingerprinting (Revision 93c31be1b75940dfd2e8a3c5954a4d57f4c8e6d5) Result = SUCCESS Christoph Kutzinski : 93c31be1b75940dfd2e8a3c5954a4d57f4c8e6d5 Files : changelog.html core/src/main/java/hudson/FilePath.java

          kutzi added a comment -

          Jesse, where did you see that Util.getDigestOf closes the passed InputStream? I cannot find such a place.
          So this issue has probably already been there before https://github.com/jenkinsci/jenkins/commit/9d72311ba0222b9d0489605b8ec2cec711690993

          It probably just manifests when fingerprinting a lot of files, since in that case the file descriptor run out, before the GC can discard and close the dangling FileOutputStreams

          kutzi added a comment - Jesse, where did you see that Util.getDigestOf closes the passed InputStream? I cannot find such a place. So this issue has probably already been there before https://github.com/jenkinsci/jenkins/commit/9d72311ba0222b9d0489605b8ec2cec711690993 It probably just manifests when fingerprinting a lot of files, since in that case the file descriptor run out, before the GC can discard and close the dangling FileOutputStreams

          Jesse Glick added a comment -

          My mistake, regressed from another commit: https://github.com/jenkinsci/jenkins/commit/51fbd2d

          Jesse Glick added a comment - My mistake, regressed from another commit: https://github.com/jenkinsci/jenkins/commit/51fbd2d
          Jesse Glick made changes -
          Assignee Original: kutzi [ kutzi ] New: Jesse Glick [ jglick ]
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

            jglick Jesse Glick
            davidschmitt David Schmitt
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: