diff --git a/packages/env/daemon/src/sys/windows.rs b/packages/env/daemon/src/sys/windows.rs index de39fd4c3..401719369 100644 --- a/packages/env/daemon/src/sys/windows.rs +++ b/packages/env/daemon/src/sys/windows.rs @@ -550,7 +550,8 @@ pub fn after_spawn(child: &Child) { } } -/// Nothing to do: the daemon cannot catch `TerminateProcess`, and the job object kills its commands with it. +/// Nothing to do: the daemon cannot catch `TerminateProcess`. When it ends, the job object kills each command's own +/// process; processes those start leave the job (silent breakaway, as in libuv) and keep running. pub fn on_exit_signal(_on_signal: impl FnOnce(i32) + Send + 'static) {} /// Node's `killProcessTree` on Windows: `taskkill /F /T`, not waited for. diff --git a/packages/env/docs/protocol.md b/packages/env/docs/protocol.md index f8ca5b4e1..c5e482856 100644 --- a/packages/env/docs/protocol.md +++ b/packages/env/docs/protocol.md @@ -62,10 +62,11 @@ command as a full pipe would. ## Liveness Each side sends `ping` every 5 seconds. The daemon kills every process group it started and exits after 30 seconds -without receiving any bytes, when stdin ends, or on `SIGTERM`, `SIGINT` or `SIGHUP` (on Windows, a job object kills -its commands with it). A dropped connection or a stopped daemon therefore stops remote commands. The client -fails requests of a lost connection with `{ code: "unknown", lost: true }` and starts a new daemon on the next request; -handles belong to the daemon that opened them, so requests on them fail instead of reaching the new one. +without receiving any bytes, when stdin ends, or on `SIGTERM`, `SIGINT` or `SIGHUP`. A dropped connection or a +stopped daemon therefore stops remote commands. On Windows, a terminated daemon cannot clean up: a job object kills +each command's own process, but not processes that one started. The client fails requests of a lost connection with +`{ code: "unknown", lost: true }` and starts a new daemon on the next request; handles belong to the daemon that opened +them, so requests on them fail instead of reaching the new one. ## Operations