forked from gradle/gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop forked exec and javaexec on build termination
Terminating a single process does not terminate its children automatically, so when Gradle terminates .bat file, it leaves the forked application running. The problem is often visible as "process exec process keeps running after build termination". The root cause is that in Windows exec uses cmd -> process.exe sequence, so aborting the build terminates "cmd.exe", and "process.exe" keeps running. The workaround is to use taskkill /PID $pid /T /F command that terminates the process tree For other operating systems, alternative solutions are needed. This commit uses Process#descendants if Gradle runs with Java 9+ Otherwise it resorts to the previous "process.destroy" sequence. fixes gradle#18716 gradle#7603 gradle#6114 gradle#3093 gradle#1128 gradle#1109 Signed-off-by: Vladimir Sitnikov <[email protected]>
- Loading branch information
Showing
2 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters