• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None

      SlaveComputer uses a ReopenableFileOutputStream for it's log
      introduced by https://github.com/jenkinsci/jenkins/commit/0ddb0c5cca757a4a34e0c162bbca6504f5cec25f, intent was to track some termination issue and report status to user.

      this results in a file-leak when channel.onClose logs termination but kill() already invoked close on the log stream. By nature, ReopenableFileOutputStream introduce a risk for a writer to reopen the stream without any control on who is responsible to close it.

      in the meantime, https://github.com/jenkinsci/jenkins/commit/733f091125099a7ed823c0d0d7cb96ae8d39f364 introduced deletion of the slave's log directory on termination (which makes previous fix useless)

      Depending on race condition, this can result in:

      • listener to fail log it's termination status - but PrintStream#write do capture the IOException and PrintStream#checkError is never checked, so silently ignored
      • slave log directory deletion to fail due to file lock issue (detected on Windows), resulting in a non-blocker error reported in Jenkins log.

          [JENKINS-37098] file leak with slave.log

          James Nord added a comment -

          ndeloof Is this closed - or is there related work on this to prevent the attempted re-open by something (or does that deserve a separate JIRA?)

          James Nord added a comment - ndeloof Is this closed - or is there related work on this to prevent the attempted re-open by something (or does that deserve a separate JIRA?)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/util/io/RewindableFileOutputStream.java
          core/src/main/java/hudson/util/io/RewindableRotatingFileOutputStream.java
          http://jenkins-ci.org/commit/jenkins/d289161de0a1c19231664cd0a5ac1fcc026f3397
          Log:
          JENKINS-37098 #2490 omitted one since tag, and incorrectly copied another.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/util/io/RewindableFileOutputStream.java core/src/main/java/hudson/util/io/RewindableRotatingFileOutputStream.java http://jenkins-ci.org/commit/jenkins/d289161de0a1c19231664cd0a5ac1fcc026f3397 Log: JENKINS-37098 #2490 omitted one since tag, and incorrectly copied another.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/util/io/RewindableFileOutputStream.java
          core/src/main/java/hudson/util/io/RewindableRotatingFileOutputStream.java
          http://jenkins-ci.org/commit/jenkins/e23d4bec1c85926bfb17b5c559edca5f42128ed8
          Log:
          Merge pull request #2580 from jglick/RewindableFileOutputStream-since

          JENKINS-37098 Since tag cleanup

          Compare: https://github.com/jenkinsci/jenkins/compare/ad70a8f49b70...e23d4bec1c85

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/util/io/RewindableFileOutputStream.java core/src/main/java/hudson/util/io/RewindableRotatingFileOutputStream.java http://jenkins-ci.org/commit/jenkins/e23d4bec1c85926bfb17b5c559edca5f42128ed8 Log: Merge pull request #2580 from jglick/RewindableFileOutputStream-since JENKINS-37098 Since tag cleanup Compare: https://github.com/jenkinsci/jenkins/compare/ad70a8f49b70...e23d4bec1c85

          Oleg Nenashev added a comment -

          The issue has been fixed and release in 2.18, hence it got into the 2.19.1 LTS. No further action required

          Oleg Nenashev added a comment - The issue has been fixed and release in 2.18, hence it got into the 2.19.1 LTS. No further action required

            ndeloof Nicolas De Loof
            ndeloof Nicolas De Loof
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: