Skip to content

Gradle process stop doesn't lead to node process stop #65

@imanushin

Description

@imanushin

Short: stopping gradle execution on Windows from command line by pressing Ctrl-C doesn't lead to stopping node.exe subprocess on Windows.

Steps to reproduce:

  1. Create project with webpack
  2. Configure start at package.json script via:
"scripts": {
    "start": "webpack-dev-server --open --config webpack.dev.js"
  }
  1. Create npmStart task via gradle kts script:
tasks {
    val npmStart by registering(NpmTask::class) {
        /*dependent tasks are skipped for simplification*/
        setArgs(listOf("run", "start"))
    }
}
  1. Start local node server via .\gradlew.bat :npmStart
  2. Wait for process start (web browser opens)
  3. Press Ctrl-C to stop node.exe execution

Expected result:
All child processes under gradle will be stopped.

Actual result:
Node.exe process remains. And this process starts to be zombie, e.g. process without parent.

Hint: probably (I'm not sure, this require testing), NpmTask should be inherited from Exec, not from DefaultTask. It means that args field will be inherited from Exec task, so it will be fully configurable via user. However next Gradle tool will be responsible to stop all child tasks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions