Skip to content

Commit ac6ecd6

Browse files
committed
doc: reword warnings about sockets passed to subprocesses
Make the docs more concise. Make warnings direct ("do not use" and "should") rather than "is not recommended" or "is recommended". PR-URL: #34273 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent a98426a commit ac6ecd6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

doc/api/child_process.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,13 +1380,12 @@ process.on('message', (m, socket) => {
13801380
});
13811381
```
13821382

1383-
Once a socket has been passed to a child, the parent is no longer capable of
1384-
tracking when the socket is destroyed. It is recommended not to use
1385-
`.maxConnections` when this occurs.
1383+
Do not use `.maxConnections` on a socket that has been passed to a subprocess.
1384+
The parent cannot track when the socket is destroyed.
13861385

1387-
It is also recommended that any `'message'` handlers in the child process
1388-
verify that `socket` exists, as the connection may have been closed during the
1389-
time it takes to send the connection to the child.
1386+
Any `'message'` handlers in the subprocess should verify that `socket` exists,
1387+
as the connection may have been closed during the time it takes to send the
1388+
connection to the child.
13901389

13911390
### `subprocess.signalCode`
13921391

0 commit comments

Comments
 (0)