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

Jenkins does not invoke ProcessKillers for Windows recursively

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core

      Currently, On Windows Jenkins calls ProcessKillers for the root process only. On Linux machines the extension point is being called for the entire process tree. The implementation should be synchronized for all platforms.

      Solution:

      • Built-in killRecursive() of WinProc should be replaced by a recursive implementation from UnixProcess (depends on JENKINS-20289)

          [JENKINS-19156] Jenkins does not invoke ProcessKillers for Windows recursively

          Oleg Nenashev added a comment -

          It is not possible to implement Cygwin Process Killer

          Oleg Nenashev added a comment - It is not possible to implement Cygwin Process Killer

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/util/ProcessTree.java
          http://jenkins-ci.org/commit/jenkins/20859b4aad63689b5338fa32f50cb731118bf16f
          Log:
          Windows::killRecursively() invokes process killers after completion.
          Resolves https://issues.jenkins-ci.org/browse/JENKINS-19156

          Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/util/ProcessTree.java http://jenkins-ci.org/commit/jenkins/20859b4aad63689b5338fa32f50cb731118bf16f Log: Windows::killRecursively() invokes process killers after completion. Resolves https://issues.jenkins-ci.org/browse/JENKINS-19156 Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>

          Oleg Nenashev added a comment -

          Previous fix invokes ProcessKiller only for top-level process.
          Built-in killRecursive() of WinProc should be replaced by manual implementation from UnixProcess

          Oleg Nenashev added a comment - Previous fix invokes ProcessKiller only for top-level process. Built-in killRecursive() of WinProc should be replaced by manual implementation from UnixProcess

          Daniel Beck added a comment -

          JENKINS-9104 seems to indicate that processes are getting killed. What is this issue about, specifically?

          Daniel Beck added a comment - JENKINS-9104 seems to indicate that processes are getting killed. What is this issue about, specifically?

          Oleg Nenashev added a comment -

          Better late than never...
          I've updated the issue title and description.

          Hopefully, I'll be able to spend some time on the winp library to implement a native getChildPids() API method.

          Oleg Nenashev added a comment - Better late than never... I've updated the issue title and description. Hopefully, I'll be able to spend some time on the winp library to implement a native getChildPids() API method.

          Daniel Beck added a comment -

          Doesn't JENKINS-9104 mean that child processes of launched processes do get killed on Windows?

          Daniel Beck added a comment - Doesn't JENKINS-9104 mean that child processes of launched processes do get killed on Windows?

          Oleg Nenashev added a comment - - edited

          Yes, JENKINS-9104 resolves the termination issue in general cases, but this issue is not related to the process termination. It means the correct handling of process termination events.

          ProcessKiller is actually an event handler for the process termination.
          It's being used to call some additional procedures (e.g. correct Cygwin processes termination in JENKINS-13615 ). Currently there's no option to fire event handlers for the each process in the tree.

          Oleg Nenashev added a comment - - edited Yes, JENKINS-9104 resolves the termination issue in general cases, but this issue is not related to the process termination. It means the correct handling of process termination events. ProcessKiller is actually an event handler for the process termination. It's being used to call some additional procedures (e.g. correct Cygwin processes termination in JENKINS-13615 ). Currently there's no option to fire event handlers for the each process in the tree.

          Oleg Nenashev added a comment -

          AFAICT this is still an open issue

          Oleg Nenashev added a comment - AFAICT this is still an open issue

            Unassigned Unassigned
            oleg_nenashev Oleg Nenashev
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: