docs(env): Windows commands' descendants survive a terminated daemon

The job object uses silent breakaway, as libuv does, so it only kills each
command's own process.
This commit is contained in:
Petr Houška 2026-10-28 21:03:07 +01:00
parent b6d5c2ecdc
commit a87b742ff4
2 changed files with 7 additions and 5 deletions

View file

@ -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.

View file

@ -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