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

Jenkins no longer kills running processes after job fails

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Jenkins 1.553 or later on CentOS 6.3 with Oracle Java 7 JDK

      Starting at version 1.553, Jenkins no longer seems to kill running processes after a build failure.

      We have several jobs that start a Tomcat instance and run various end-to-end-tests; if the build fails Jenkins doesn't execute the shutdown scripts and we rely on the process killer to clean up the Tomcat instance.

      This can be duplicated more easily by creating a free-form job and adding two shell scripts, the first that starts a simple command such as "nohup sleep 10000 &" and the second "/bin/false". After the job exits the sleep process is still running. Prior to version 1.553, it would be killed.

      There are no log messages to indicate a problem.

      I can reproduce this on CentOS 6, Red Hat EL 5 and Red Hat EL 4, both with a job running on the local master, and on a slave node. Also tested with both 32-bit and 64-bit Oracle Java 7 JDKs.

      We're using the built-in Winstone container.

          [JENKINS-22641] Jenkins no longer kills running processes after job fails

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3538
          [FIXED JENKINS-22641] FileUtils.readFileToByteArray behavior has changed in the latest version of commons-io. (Revision 410f06adfa798d29118c77ed01c5c02fc207cb02)
          Add test unit for JENKINS-22641 (Revision 0d4c0cb6b274bfa18c810fcf761e3ad8b27ceb34)
          JENKINS-22641 Noting merge of #1322. (Revision 14a147eda8eebfd78c1cc53e1d59232d720de6b7)

          Result = SUCCESS
          schristou88 : 410f06adfa798d29118c77ed01c5c02fc207cb02
          Files :

          • core/src/main/java/hudson/util/ProcessTree.java

          schristou88 : 0d4c0cb6b274bfa18c810fcf761e3ad8b27ceb34
          Files :

          • test/src/test/java/hudson/util/ProcessTreeKillerTest.java

          Jesse Glick : 14a147eda8eebfd78c1cc53e1d59232d720de6b7
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #3538 [FIXED JENKINS-22641] FileUtils.readFileToByteArray behavior has changed in the latest version of commons-io. (Revision 410f06adfa798d29118c77ed01c5c02fc207cb02) Add test unit for JENKINS-22641 (Revision 0d4c0cb6b274bfa18c810fcf761e3ad8b27ceb34) JENKINS-22641 Noting merge of #1322. (Revision 14a147eda8eebfd78c1cc53e1d59232d720de6b7) Result = SUCCESS schristou88 : 410f06adfa798d29118c77ed01c5c02fc207cb02 Files : core/src/main/java/hudson/util/ProcessTree.java schristou88 : 0d4c0cb6b274bfa18c810fcf761e3ad8b27ceb34 Files : test/src/test/java/hudson/util/ProcessTreeKillerTest.java Jesse Glick : 14a147eda8eebfd78c1cc53e1d59232d720de6b7 Files : changelog.html

          Code changed in jenkins
          User: Jesse Glick
          Path:
          test/src/test/java/hudson/util/ProcessTreeKillerTest.java
          http://jenkins-ci.org/commit/jenkins/0f3574bbc109935e37bbd473c2a9e7b7625e3ced
          Log:
          Merge branch 'JENKINS-22641' of github.com:christ66/jenkins

          Compare: https://github.com/jenkinsci/jenkins/compare/37c5bc2fd861...0f3574bbc109

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/test/java/hudson/util/ProcessTreeKillerTest.java http://jenkins-ci.org/commit/jenkins/0f3574bbc109935e37bbd473c2a9e7b7625e3ced Log: Merge branch ' JENKINS-22641 ' of github.com:christ66/jenkins Compare: https://github.com/jenkinsci/jenkins/compare/37c5bc2fd861...0f3574bbc109

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/durable_task/ShellStepTest.java
          http://jenkins-ci.org/commit/workflow-plugin/e74fd8349c15568354fc3934010713503d22761f
          Log:
          added a test bug this is blocked by JENKINS-22641

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/durable_task/ShellStepTest.java http://jenkins-ci.org/commit/workflow-plugin/e74fd8349c15568354fc3934010713503d22761f Log: added a test bug this is blocked by JENKINS-22641

          Code changed in jenkins
          User: christ66
          Path:
          test/src/test/java/hudson/util/ProcessTreeKillerTest.java
          http://jenkins-ci.org/commit/jenkins/86c44d8f5fa7d98246bda76d9fb22fd60a4f8530
          Log:
          Add test unit for JENKINS-22641

          (cherry picked from commit 0d4c0cb6b274bfa18c810fcf761e3ad8b27ceb34)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: christ66 Path: test/src/test/java/hudson/util/ProcessTreeKillerTest.java http://jenkins-ci.org/commit/jenkins/86c44d8f5fa7d98246bda76d9fb22fd60a4f8530 Log: Add test unit for JENKINS-22641 (cherry picked from commit 0d4c0cb6b274bfa18c810fcf761e3ad8b27ceb34)

          Don Bogardus added a comment -

          This issue has returned as of version 1.587 (through current version - 1.593)

          It was fixed in 1.565.3 through 1.586

          Same behavior as original bug, leaves processes running when job is killed.

          Don Bogardus added a comment - This issue has returned as of version 1.587 (through current version - 1.593) It was fixed in 1.565.3 through 1.586 Same behavior as original bug, leaves processes running when job is killed.

          Jesse Glick added a comment -

          dbogardus then your issue is probably a distinct bug with a similar symptom but potentially distinct preconditions and root cause. Better to file it as a new ticket, with any steps to reproduce you can muster, and mark it as “blocking” this one.

          Jesse Glick added a comment - dbogardus then your issue is probably a distinct bug with a similar symptom but potentially distinct preconditions and root cause. Better to file it as a new ticket, with any steps to reproduce you can muster, and mark it as “blocking” this one.

          Don Bogardus added a comment -

          Created JENKINS-26048 for similar bug returning in 1.587.

          Don Bogardus added a comment - Created JENKINS-26048 for similar bug returning in 1.587.

          Also see in Jenkins ver. 1.580.1
          Project type: Maven

          Dilip Mahadevappa added a comment - Also see in Jenkins ver. 1.580.1 Project type: Maven

          Daniel Beck added a comment -

          Dilip M: That's probably JENKINS-26048. Maven project type works differently from freestyle.

          Daniel Beck added a comment - Dilip M: That's probably JENKINS-26048 . Maven project type works differently from freestyle.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/test/java/org/jenkinsci/plugins/durabletask/BourneShellScriptTest.java
          http://jenkins-ci.org/commit/durable-task-plugin/fc48f447763cb69d6ebf7c67e54e476d9e903bbd
          Log:
          Added test for stop.
          JENKINS-22641 means that this does not work in 1.554.3, so need to bump up the dependency to 1.565.3.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/test/java/org/jenkinsci/plugins/durabletask/BourneShellScriptTest.java http://jenkins-ci.org/commit/durable-task-plugin/fc48f447763cb69d6ebf7c67e54e476d9e903bbd Log: Added test for stop. JENKINS-22641 means that this does not work in 1.554.3, so need to bump up the dependency to 1.565.3.

            schristou Steven Christou
            toadnik17 Todd Perry
            Votes:
            12 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated:
              Resolved: