From ddae11213302254792758cea21f6e73ae0848552 Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Thu, 11 Feb 2021 20:59:00 +0200 Subject: [PATCH] child_process: fix spawn and fork abort behavior Fix AbortSignal in Spawn which doesn't actually abort the process, and fork can emit an AbortError even if the process was already exited. Add documentation For killSignal. Fixes: https://github.com/nodejs/node/issues/37273 PR-URL: https://github.com/nodejs/node/pull/37325 Reviewed-By: Benjamin Gruenbaum --- doc/api/child_process.md | 10 +++ lib/child_process.js | 33 ++++--- ...rocess-exec-abortcontroller-promisified.js | 27 +++--- .../test-child-process-fork-abort-signal.js | 45 +++++++++- .../test-child-process-spawn-controller.js | 90 ++++++++++++++++--- 5 files changed, 165 insertions(+), 40 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index ee8f0b4f0bc939..b7fce216282012 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -351,6 +351,9 @@ controller.abort();