Skip to content

Gradle doesn't correctly kill subprocesses on interrupt on Windows. It should. #18716

@doctorpangloss

Description

@doctorpangloss
  1. Use Windows.
  2. Open a console of any kind, in any Windows environment - cmd, powershell or the bash that ships with git.
  3. Start a gradle task with an exec that never finishes.
  4. Hit Ctrl+C or any preferred interrupt method.
  5. Observe the process started by exec is not terminated.

Numerous people report issues related to this: #7603 #6114 #3093 #1128 #1109

I fixed this issue in NuProcess - brettwooldridge/NuProcess#133 - which you should use instead of ProcessBuilder on Windows. You will need to ping them to merge my PR.

You can trap Ctrl+C and use it to kill the subprocesses using NuProcess, or permit Ctrl+C to kill the daemon and using NuProcess, result in the child processes being terminated correctly.

Otherwise, Gradle is working really great for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed:duplicateDuplicated or superseeded by another issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions