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

Resource leak in hudson.model.FileParameterValue

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      A FileInputStream is not closed in hudson.model.FileParameterValue for "return IOUtils.toByteArray(new FileInputStream(file))".
      This is a resource leak.

      The FileInputStream should be closed, using finally. For example:

      final InputStream input = new FileInputStream(file);
      try {
          return IOUtils.toByteArray(input);
      } finally {
          input.close();
      }
      

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          The PR just hangs for several weeks...
          https://github.com/jenkinsci/jenkins/pull/1225

          Show
          oleg_nenashev Oleg Nenashev added a comment - The PR just hangs for several weeks... https://github.com/jenkinsci/jenkins/pull/1225
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/FileParameterValue.java
          http://jenkins-ci.org/commit/jenkins/8767ddb192cf752c7d28f512884b9ecd3b9cdbd4
          Log:
          [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/FileParameterValue.java http://jenkins-ci.org/commit/jenkins/8767ddb192cf752c7d28f512884b9ecd3b9cdbd4 Log: [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/FileParameterValue.java
          http://jenkins-ci.org/commit/jenkins/d2fb6d918c97b7b568eeff5b43e7095cbcb5d107
          Log:
          Merge pull request #1225 from synopsys-arc-oss/jenkins22693-inputstream-fix

          [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue

          Compare: https://github.com/jenkinsci/jenkins/compare/e7ca7ae9ec4a...d2fb6d918c97

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/FileParameterValue.java http://jenkins-ci.org/commit/jenkins/d2fb6d918c97b7b568eeff5b43e7095cbcb5d107 Log: Merge pull request #1225 from synopsys-arc-oss/jenkins22693-inputstream-fix [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue Compare: https://github.com/jenkinsci/jenkins/compare/e7ca7ae9ec4a...d2fb6d918c97
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #3419
          [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue (Revision 8767ddb192cf752c7d28f512884b9ecd3b9cdbd4)

          Result = SUCCESS
          o.v.nenashev : 8767ddb192cf752c7d28f512884b9ecd3b9cdbd4
          Files :

          • core/src/main/java/hudson/model/FileParameterValue.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3419 [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue (Revision 8767ddb192cf752c7d28f512884b9ecd3b9cdbd4) Result = SUCCESS o.v.nenashev : 8767ddb192cf752c7d28f512884b9ecd3b9cdbd4 Files : core/src/main/java/hudson/model/FileParameterValue.java
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/FileParameterValue.java
          http://jenkins-ci.org/commit/jenkins/eb9cbead0b117e0544871d17e7077e7837a60bb7
          Log:
          [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
          (cherry picked from commit 8767ddb192cf752c7d28f512884b9ecd3b9cdbd4)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/FileParameterValue.java http://jenkins-ci.org/commit/jenkins/eb9cbead0b117e0544871d17e7077e7837a60bb7 Log: [FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com> (cherry picked from commit 8767ddb192cf752c7d28f512884b9ecd3b9cdbd4)

            People

            • Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              evernat evernat
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: