From 1dd265384b24b17d9460689a6a478b123ebd61a7 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 8 Jul 2020 22:32:13 -0700 Subject: [PATCH] doc: reword warnings about sockets passed to subprocesses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the docs more concise. Make warnings direct ("do not use" and "should") rather than "is not recommended" or "is recommended". Backport-PR-URL: https://github.com/nodejs/node/pull/34377 PR-URL: https://github.com/nodejs/node/pull/34273 Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Anto Aravinth Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat --- doc/api/child_process.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 04ed991fed6fec..d88adf49885b11 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1380,14 +1380,12 @@ process.on('message', (m, socket) => { }); ``` -Once a socket has been passed to a child, the parent is no longer capable of -tracking when the socket is destroyed. To indicate this, the `.connections` -property becomes `null`. It is recommended not to use `.maxConnections` when -this occurs. - -It is also recommended that any `'message'` handlers in the child process -verify that `socket` exists, as the connection may have been closed during the -time it takes to send the connection to the child. +Do not use `.maxConnections` on a socket that has been passed to a subprocess. +The parent cannot track when the socket is destroyed. + +Any `'message'` handlers in the subprocess should verify that `socket` exists, +as the connection may have been closed during the time it takes to send the +connection to the child. ### `subprocess.signalCode`