GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — doc: note synchronous part of child_process.spawn by davisjam · Pull Request #21234 · nodejs/node Conversation
|
|
CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite/869/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Isn't this only an issue until V8 incorporates the patch mentioned in the original issue? If so, is this really worth it and are we going to remember to remove the text if/when V8 lands the proposed change? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mscdex, fair point. However, I'm not aware of any movement on that patch since it was opened in January. On a related note, is there a system in place to track documentation tied to change requests to dependencies like V8 or libuv? In favor of this PR, several people commented on #14917 and noted how long it took them to identify the root cause. Adding this documentation should help. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This might not be a good idea but maybe it is?: Include a link to the V8 issue with an explanation that after it lands and is downstreamed to Node.js core, the problem goes away. That will at least have the potential to tip someone else off that the paragraph can be removed at that time. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Trott I like this idea. Something like "As noted here, ...". ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Maybe "As noted in V8 issue 7381" instead of "here"? But otherwise, yeah, something like that. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nodejs/documentation @nodejs/child_process |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm -.2 on documenting this because the synopsis is already too long.
For most people this will just be a piece of irrelevant trivia or possibly a source of irrational fear ("I can't use child processes because performance" even though it's insignificant 99.99% of the time.)
If you look at e.g. python's subprocess or ruby's process docs, they don't mention this caveat either even though they're just as susceptible.
(I didn't fully check perl since it has a gazillion ways to start a child process but the few I checked don't mention it either.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| the event loop until the spawned process either exits or is terminated. | ||
|
|
||
| *Note*: On some operating systems, the [`child_process.spawn()`][] method | ||
| performs memory operations synchronously before decoupling the event loop |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd be more specific and write "On UNIX-like operating systems" and tweak the wording to clarify that it's the underlying fork() system call that is responsible for copying memory, not child_process.spawn() (directly.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I like "UNIX-like" (217acc4), but I don't think we need to go into detail on the root cause. The V8 link explains things.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
True. But Node embraces a single-threaded event loop, so I think it's more important that we document potential blocking calls -- especially calls that are listed as the "asynchronous" version of things.
I agree that the synopsis is pretty long. What about nestling this note in the API documentation for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yep, sounds good. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| function provides equivalent functionality in a synchronous manner that blocks | ||
| the event loop until the spawned process either exits or is terminated. | ||
|
|
||
| *Note*: On UNIX-like operating systems, the [`child_process.spawn()`][] method |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just a nit: The *Note*: part is unnecessary.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnoordhuis Check the new location. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Lite CI: https://ci.nodejs.org/job/node-test-pull-request-lite/886/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks like this PR has approval. Shall I merge? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
CI is green, nobody seems to object, it has multiple approvals, and it's been open more than 72 hours. GO FOR IT!
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
If an application has a large RSS (GB), jorangreef observed that child_process.spawn will block the event loop for ms-s. This is surprising behavior and merits documentation. Refs: #14917 PR-URL: #21234 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
|
Landed in 25e5ae4 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
If an application has a large RSS (GB), jorangreef observed that child_process.spawn will block the event loop for ms-s. This is surprising behavior and merits documentation. Refs: #14917 PR-URL: #21234 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.