Skip to content

Use taskkill windows

Steve Xuereb requested to merge use-taskkill-windows into master

👋 Blocked by !1743 (merged), at the moment targeting add-process-group-to-process-pkg to make diff simple 👋

What does this MR do?

Use windows taskkill command to terminate process.

Why was this MR needed?

process.Kill doesn't kill child processes only the PID we specify. Using taskkill /T will kill any child process it spawns. More information in https://stackoverflow.com/questions/22470193/why-wont-go-kill-a-child-process-correctly#answer-44551450. This also makes is consistent with the shell executor termination

Calling process.Kill will only send the kill signal to the parent process, but will not send the process signal to the child process. Using taskkill directory we can send the signal to child processes using the /T flag. With ForceKill we also pass the /F flag to force kill a process.

This also makes is consistent with the shell executor termination 945ebf3e

In #3121 (closed) we plan to improve this to support graceful termination on Windows as discussed in !1797 (comment 278918582)

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Edited by Steve Xuereb

Merge request reports