Make windows stdio pipes async (?) #4964
Replies: 0 comments 7 replies
-
cc @nodejs/platform-windows |
Beta Was this translation helpful? Give feedback.
-
There's been no further activity on this in over a year and no clear resolution for it. Closing but adding it to the Futures project board so it does not get lost |
Beta Was this translation helpful? Give feedback.
-
Fwiw, this is something that should ideally still happen at some point. |
Beta Was this translation helpful? Give feedback.
-
Perhaps, then, we should reopen with a feature request label? |
Beta Was this translation helpful? Give feedback.
-
It’s not really a public feature. I think we could also put it under the general “stdio weirdness” umbrella, I think there’s a tracking issue for that somewhere. |
Beta Was this translation helpful? Give feedback.
-
pls see nodejs/node#20000 (comment) . I think we could have a general discussion around |
Beta Was this translation helpful? Give feedback.
-
Question, if node is setting windows pipes to blocking by default, this should mean that these 2 lines: process.stdout._handle.setBlocking(true);
process.stderr._handle.setBlocking(true); If added to the top of a script should have no effect right? However this doesn't appear to be case. I have a jest test that succeeds when I set the 2 lines above, but fails when I don't have those 2 lines. These tests run on a windows CI/CD machine. Linux and MacOS are not affected. I've done these tests repetitively toggling between true and false. But I always see an effect with those 2 lines enabled. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I had been meaning to look into doing this for some time, as noted in nodejs/node#25638 (review).
tl;dr the only reason (so far as I could tell) that windows pipes are sync is that at the time they were made sync, unix was also sync (for some reason that I don't recall).
(They were made blocking in nodejs/node@20176a9 as a response to nodejs/node-v0.x-archive#3584.)
Anyways I tried to do it with the following patch, but it caused more CI errors than I had expected, across all windows machines, and I'm not sure I am invested enough to deal with them so I'll leave them here in case anyone is interested.
(Patch to make windows pipes async again.)
...
46 Failures:
``` test.parallel/test-child-process-stdout-flush-exit test.parallel/test-cli-eval test.parallel/test-module-main-fail test.parallel/test-preload test.parallel/test-module-main-fail test.parallel/test-preload test.parallel/test-worker-memory test.parallel/test-debug-usage test.parallel/test-module-main-preserve-symlinks-fail test.parallel/test-stdio-pipe-redirect test.parallel/test-stdout-close-catch test.sequential/test-stream2-stderr-sync test.parallel/test-child-process-stdout-flush-exit test.parallel/test-debug-usage test.parallel/test-module-main-preserve-symlinks-fail test.parallel/test-stdio-pipe-redirect test.sequential/test-stream2-stderr-sync test.parallel/test-module-main-fail test.parallel/test-preload test.sequential/test-repl-timeout-throw test.parallel/test-module-main-fail test.parallel/test-preload test.sequential/test-repl-timeout-throw test.parallel/test-debugger-pid test.parallel/test-child-process-stdout-flush-exit test.parallel/test-cli-eval test.parallel/test-debug-usage test.parallel/test-module-main-preserve-symlinks-fail test.sequential/test-stream2-stderr-sync test.parallel/test-child-process-stdout-flush-exit test.parallel/test-cli-eval test.parallel/test-debug-usage test.parallel/test-module-main-preserve-symlinks-fail test.parallel/test-stdio-pipe-redirect test.parallel/test-stdout-close-catch test.sequential/test-stream2-stderr-sync test.parallel/test-child-process-stdout-flush-exit test.parallel/test-cli-eval test.parallel/test-module-main-fail test.parallel/test-preload test.sequential/test-repl-timeout-throw test.parallel/test-debug-usage test.parallel/test-module-main-preserve-symlinks-fail test.parallel/test-stdio-pipe-redirect test.parallel/test-stdout-close-catch test.sequential/test-stream2-stderr-sync ```...
Link to the CI run while it lasts: https://ci.nodejs.org/job/node-test-commit-windows-fanned/24192/
It's possible there was some other reason that windows pipes were made sync or some other implication or side effect I don't know about, but I'm not invested enough to debug it.
Anyways I made this issue if nothing else for posterity in case people are interested.
Beta Was this translation helpful? Give feedback.
All reactions