-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: update child_process.md #19075
doc: update child_process.md #19075
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion about the comment itself.
doc/api/child_process.md
Outdated
in excess of that limit without capturing the output, that can cause the process | ||
to hang. This is identical behavior to the behavior of pipes in the shell. | ||
If you don't plan on consuming the output from the child process, create it | ||
with { stdio: 'ignore' }.* It is possible to stream data It is possible to stream data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like here is a copy paste error. It is possible to stream data
is duplicated.
doc/api/child_process.md
Outdated
@@ -27,7 +27,12 @@ ls.on('close', (code) => { | |||
``` | |||
|
|||
By default, pipes for `stdin`, `stdout`, and `stderr` are established between | |||
the parent Node.js process and the spawned child. It is possible to stream data | |||
the parent Node.js process and the spawned child. *Note that these pipes have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to remove Note
and not to have it italic.
1718f30
to
31ac81d
Compare
doc/api/child_process.md
Outdated
in excess of that limit without capturing the output, that can cause the process | ||
to hang. This is identical behavior to the behavior of pipes in the shell. | ||
If you don't plan on consuming the output from the child process, create it | ||
with { stdio: 'ignore' }. It is possible to stream data through these pipes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please place { stdio: 'ignore' }
within backticks: `{ stdio: 'ignore' }`
. Thanks!
doc/api/child_process.md
Outdated
the parent Node.js process and the spawned child. These pipes have | ||
limited (and platform-specific) capacity, and if a process writes stdout | ||
in excess of that limit without capturing the output, that can cause the process | ||
to hang. This is identical behavior to the behavior of pipes in the shell. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "hang" a term we want to use? (We may already use it elsewhere, but I'm not sure it is sufficiently specific. I'm also not sure what a better term is, though. /cc @nodejs/documentation )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Don't use behavior
twice in the same sentence. Maybe this instead?: "This is identical to the behavior of pipes in the shell."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Trott I definitely see what you mean, maybe something like "...this can cause the child process to block waiting for the pipe buffer to accept more data." would be better? Borrowing from the description provided in the Python docs for subprocess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that. (I also don't fell that strongly about "hang" so if you or others prefer to keep it that way, you can ignore my comment.)
doc/api/child_process.md
Outdated
limited (and platform-specific) capacity, and if a process writes stdout | ||
in excess of that limit without capturing the output, that can cause the process | ||
to hang. This is identical behavior to the behavior of pipes in the shell. | ||
If you don't plan on consuming the output from the child process, create it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per our style guide, avoid personal pronouns in the API docs. Maybe change this sentence to this?:
Use the `{stdio: 'ignore' }` option if the output will not be consumed.
doc/api/child_process.md
Outdated
with { stdio: 'ignore' }. It is possible to stream data through these pipes | ||
in a non-blocking way. *Note, however, that some programs use line-buffered | ||
I/O internally. While that does not affect Node.js, it can mean that data sent | ||
to the child process may not be immediately consumed.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional nit: While we're in here, maybe remove the arbitrary-seeming italics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @AriLFrankel and welcome! Thank you for the pull request! Documentation changes can often attract a lot of tiny comments. Don't get discouraged!
31ac81d
to
5e5e0ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with my comment addressed.
doc/api/child_process.md
Outdated
limited (and platform-specific) capacity. If the child process writes to | ||
stdout in excess of that limit without the output being captured, the child | ||
process will block waiting for the pipe buffer to accept more data. This is | ||
identical to the behavior of pipes in the shell. Use the `{stdio: 'ignore' }` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please either remove the whitespace at the end or add one at the beginning of the object.
Add an explanation of the risk of exceeding platform pipe capacity with uncaptured output in child_process.spawn with stdio of pipe Fixes: nodejs#4236
5e5e0ea
to
01aa950
Compare
@nodejs/child_process I think it would be good to have another LG here. |
@BridgeAR Do you feel this is ready to move out of "author ready"? |
|
@BridgeAR Got ya thanks for the clarification! I was a bit confused I think by the docs for author-ready. |
Landed in 5fdee52 🎉 |
Add an explanation of the risk of exceeding platform pipe capacity with uncaptured output in child_process.spawn with stdio of pipe PR-URL: #19075 Fixes: #4236 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add an explanation of the risk of exceeding platform pipe capacity with uncaptured output in child_process.spawn with stdio of pipe PR-URL: #19075 Fixes: #4236 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add an explanation of the risk of exceeding platform pipe capacity with uncaptured output in child_process.spawn with stdio of pipe PR-URL: #19075 Fixes: #4236 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add an explanation of the risk of exceeding platform pipe capacity with uncaptured output in child_process.spawn with stdio of pipe
Fixes: #4236
Checklist
Affected core subsystem(s)
doc