-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
child_process: fix stdio sockets creation #18701
Conversation
`readable` and `writable` properties can be passed directly to the `net.Socket` constructor. This change also avoids an unnecessary call to `read(0)` on the `stdin` socket. This behavior was disclosed when trying to merge `[email protected]` and specifically this commit: libuv/libuv@fd04939. Refs: libuv/libuv#1655
@santigimeno please always trigger a CI after creating a PR :-) |
@BridgeAR yeah, I had done so but forgot to post it here: https://ci.nodejs.org/job/node-test-pull-request/13083/. Anyway, thanks for the heads up. |
04018b8
to
28e7555
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.
By any chance did you test with that libuv commit? It would be nice to be able to re-land that.
Windows is better about already doing this, so this will make the behavior of these flags more consistent across platforms. It also is just better to set these flags to reflect the actual mode of the stream, rather than guessing at it based on typical usage. Refs: libuv#1655 Refs: nodejs/node#18701
Landed in b74a6da 🎉 |
`readable` and `writable` properties can be passed directly to the `net.Socket` constructor. This change also avoids an unnecessary call to `read(0)` on the `stdin` socket. This behavior was disclosed when trying to merge `[email protected]` and specifically this commit: libuv/libuv@fd04939. PR-URL: nodejs#18701 Refs: libuv/libuv#1655 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
`readable` and `writable` properties can be passed directly to the `net.Socket` constructor. This change also avoids an unnecessary call to `read(0)` on the `stdin` socket. This behavior was disclosed when trying to merge `[email protected]` and specifically this commit: libuv/libuv@fd04939. PR-URL: #18701 Refs: libuv/libuv#1655 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
`readable` and `writable` properties can be passed directly to the `net.Socket` constructor. This change also avoids an unnecessary call to `read(0)` on the `stdin` socket. This behavior was disclosed when trying to merge `[email protected]` and specifically this commit: libuv/libuv@fd04939. PR-URL: #18701 Refs: libuv/libuv#1655 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
`UV_READABLE_PIPE` and `UV_WRITABLE_PIPE` flags should be honored on unices. Windows is better about already doing this, so this will make the behavior of these flags more consistent across platforms. It also is just better to set these flags to reflect the actual mode of the stream, rather than guessing at it based on typical usage. Refs: #1655 Refs: nodejs/node#18701 PR-URL: #1741 Reviewed-By: Santiago Gimeno <[email protected]>
`readable` and `writable` properties can be passed directly to the `net.Socket` constructor. This change also avoids an unnecessary call to `read(0)` on the `stdin` socket. This behavior was disclosed when trying to merge `[email protected]` and specifically this commit: libuv/libuv@fd04939. PR-URL: nodejs#18701 Refs: libuv/libuv#1655 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
`readable` and `writable` properties can be passed directly to the `net.Socket` constructor. This change also avoids an unnecessary call to `read(0)` on the `stdin` socket. This behavior was disclosed when trying to merge `[email protected]` and specifically this commit: libuv/libuv@fd04939. PR-URL: #18701 Refs: libuv/libuv#1655 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
`readable` and `writable` properties can be passed directly to the `net.Socket` constructor. This change also avoids an unnecessary call to `read(0)` on the `stdin` socket. This behavior was disclosed when trying to merge `[email protected]` and specifically this commit: libuv/libuv@fd04939. PR-URL: #18701 Refs: libuv/libuv#1655 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Since commit 1d90700 child processes have not correctly emitted a close event for stdin. This change triggers a zero-byte read from the Socket constructor for any child process sockets. That allows the close event to be detected. Refs: nodejs#18701
readable
andwritable
properties can be passed directly to thenet.Socket
constructor. This change also avoids an unnecessary callto
read(0)
on thestdin
socket. This behavior was disclosed whentrying to merge
[email protected]
and specifically this commit:libuv/libuv@fd04939.
Refs: libuv/libuv#1655
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
child_process