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

File Leak in libraryResource pipeline step

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Any Jenkins server using v2.10 of the workflow-cps-global-lib plugin
    • Similar Issues:
    • Released As:
      workflow-cps-global-lib 2.11

      Description

      Recently, we have been seeing our Jenkins instance regularly consume a ton of file descriptors, to the point of maxing out the users limit.

      This growth is quite visible when using the monitoring plugin attached at the bottom.

      We had fairly stable performance up until this point.

      In investigating, the files that were open in large frequencies were almost always files that had been loaded with the libraryResource pipeline step.

      Upon further investigation, I found this recent change: https://github.com/jenkinsci/workflow-cps-global-lib-plugin/commit/e03488893cdeabe4738a443a0bfadd5306c46b73#diff-fd5e052acc6b8e96384fe9ab7850852aL205

      Previously, the implementation used FilePath.readToString() in order to read the file.  This method uses a try-with-resources to read the InputStream, ensuring the input is closed prior to the method exiting.

      The newer implementation has lost this safety, causing a file leak anytime a file is ready with libraryResource.

       

      We had fairly 

        Attachments

          Activity

          Hide
          tschaible Tom Schaible added a comment -

          I have proposed the following pull-request to fix this issue: https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/52

          Show
          tschaible Tom Schaible added a comment - I have proposed the following pull-request to fix this issue:  https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/52
          Hide
          dnusbaum Devin Nusbaum added a comment -

          Thanks Tom Schaible! I just released the fix in workflow-cps-global-lib 2.11.

          Show
          dnusbaum Devin Nusbaum added a comment - Thanks Tom Schaible ! I just released the fix in workflow-cps-global-lib 2.11.
          Hide
          tschaible Tom Schaible added a comment -

          With the release of 2.11 installed our performance has returned to normal, i'll close this out.

          Show
          tschaible Tom Schaible added a comment - With the release of 2.11 installed our performance has returned to normal, i'll close this out.

            People

            • Assignee:
              tschaible Tom Schaible
              Reporter:
              tschaible Tom Schaible
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: