nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.44k stars 2.33k forks source link

19.8.1 leaves dangling child processes on Windows #28207

Open CreativeTechGuy opened 1 week ago

CreativeTechGuy commented 1 week ago

Current Behavior

When pressing ctrl+c on windows to kill a NX command (eg: a dev server), it leaves all of the sub-processes (node, esbuild, vite, etc) running.

Expected Behavior

When pressing ctrl+c on windows to kill a NX command (eg: a dev server), it should kill all of the processes which were created.

GitHub Repo

No response

Steps to Reproduce

  1. Run a NX command which uses the nx:run-commands executor
  2. Kill the command in the terminal with ctrl+c
  3. Check Windows Task Manager to see that the process that was started is still running (this is easiest to see if the first process starts a server on a port since the second run will now fail since that port is still in-use)

Nx Report

Node           : 20.17.0
OS             : win32-x64
Native Target  : x86_64-windows
pnpm           : 9.11.0

nx                 : 19.8.1
@nx/js             : 19.8.1
@nx/jest           : 19.8.1
@nx/linter         : 19.8.1
@nx/eslint         : 19.8.1
@nx/workspace      : 19.8.1
@nx/devkit         : 19.8.1
@nx/esbuild        : 19.8.1
@nx/eslint-plugin  : 19.8.1
@nx/plugin         : 19.8.1
@nrwl/tao          : 19.8.1
@nx/vite           : 19.8.1
typescript         : 5.6.2

Failure Logs

N/A

Package Manager Version

No response

Operating System

Additional Information

This is the commit which broke it: https://github.com/nrwl/nx/pull/28073

This is the NodeJS reference for why it's broken: https://github.com/nodejs/node/issues/29837#issuecomment-538438824

BitBuf commented 1 week ago

Issue still present on 19.8.2, we've rolled back to 19.8.0 in the meantime.