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

XShell does not kill running process if job is getting aborted

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • xshell-plugin
    • None
    • Jenkins 1.580.1 with XShell 0.9
    • 120.v1307d168def8

      As we have seen lately XShell is not able to kill a running process once it is running on the slave, and the user aborts the job on the master machine.

      Current result is that the job is marked as aborted on the master, but it is still running on the client. This totally breaks our testruns because Jenkins thinks the node is free again, and schedules the next job for this node. But given that by our definition only a single job can run on a node, it will fail.

      The Jenkins log shows the following when aborting a job:

      mozilla-aurora_update #2 aborted
      java.lang.InterruptedException: sleep interrupted
      at java.lang.Thread.sleep(Native Method)
      at hudson.plugins.xshell.XShellBuilder.perform(XShellBuilder.java:158)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:585)
      at hudson.model.Run.execute(Run.java:1684)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)

          [JENKINS-25600] XShell does not kill running process if job is getting aborted

          Henrik Skupin added a comment -

          Henrik Skupin added a comment - Could this have been caused by https://github.com/jenkinsci/xshell-plugin/pull/8?

          Henrik Skupin added a comment -

          Oh, and this is indeed a regression between version 0.8 and 0.9.

          Henrik Skupin added a comment - Oh, and this is indeed a regression between version 0.8 and 0.9.

          So you're killing the build through Jenkins, rather than it timing out?

          Jeremy Marshall added a comment - So you're killing the build through Jenkins, rather than it timing out?

          Henrik Skupin added a comment -

          That's correct. Via the red button as visible in the console output in the top right, or in the node list in the dashboard.

          Henrik Skupin added a comment - That's correct. Via the red button as visible in the console output in the top right, or in the node list in the dashboard.

          Henrik Skupin added a comment -

          Ok, I was able to get XShell built on my own and I checked a build before and after the above landed PR. As I'm able to see the broken behavior as reported here is really caused by your patch from PR #8.

          Henrik Skupin added a comment - Ok, I was able to get XShell built on my own and I checked a build before and after the above landed PR. As I'm able to see the broken behavior as reported here is really caused by your patch from PR #8.

          fixed in PR https://github.com/jenkinsci/xshell-plugin/pull/13

          I added a try block to catch the abort and kill the process

          Jeremy Marshall added a comment - fixed in PR https://github.com/jenkinsci/xshell-plugin/pull/13 I added a try block to catch the abort and kill the process

          Rethrowing abort to set job to aborted.

          Jeremy Marshall added a comment - Rethrowing abort to set job to aborted.

          Code changed in jenkins
          User: JeremyMarshall
          Path:
          src/main/java/hudson/plugins/xshell/XShellBuilder.java
          http://jenkins-ci.org/commit/xshell-plugin/2ffbffa3dc993d188a39df7db6cbb93cdd43aaa9
          Log:
          JENKINS-25600 fix user abort

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: JeremyMarshall Path: src/main/java/hudson/plugins/xshell/XShellBuilder.java http://jenkins-ci.org/commit/xshell-plugin/2ffbffa3dc993d188a39df7db6cbb93cdd43aaa9 Log: JENKINS-25600 fix user abort

          Code changed in jenkins
          User: Marco Ambu
          Path:
          src/main/java/hudson/plugins/xshell/XShellBuilder.java
          http://jenkins-ci.org/commit/xshell-plugin/9da2ce427c43f4db9fa062cf4a1e8e6943a0810b
          Log:
          Merge pull request #13 from JeremyMarshall/master

          JENKINS-25600 fix user abort

          Compare: https://github.com/jenkinsci/xshell-plugin/compare/d29b3cb1f4db...9da2ce427c43

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Marco Ambu Path: src/main/java/hudson/plugins/xshell/XShellBuilder.java http://jenkins-ci.org/commit/xshell-plugin/9da2ce427c43f4db9fa062cf4a1e8e6943a0810b Log: Merge pull request #13 from JeremyMarshall/master JENKINS-25600 fix user abort Compare: https://github.com/jenkinsci/xshell-plugin/compare/d29b3cb1f4db...9da2ce427c43

            jeremym Jeremy Marshall
            whimboo Henrik Skupin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: