• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Any Jenkins server using v2.10 of the workflow-cps-global-lib plugin
    • workflow-cps-global-lib 2.11

      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 

          [JENKINS-53485] File Leak in libraryResource pipeline step

          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

          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

          Devin Nusbaum added a comment -

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

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

          Tom Schaible added a comment -

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

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

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

              Created:
              Updated:
              Resolved: