-
Notifications
You must be signed in to change notification settings - Fork 7.3k
process.stdout and process.stderr get flushed out-of-order in Windows when piped #6249
Comments
try node translate.js 2>&1 | find std because what you are doing is letting node output to stderr and find to std out if I'm not mistaken.
|
Derp. Thanks!
I'll close the issue. But PLZ OMG FIX #3584 THX |
Run using cmd.exe and periodically get it out of order...
|
In powershell, I occasionally get out of order results (I'm piping to C:\tmp\node-issue-6249 > node .\translation-party.js 2>&1 | % { "$_" } [stdout] this [stderr] is [stdout] a [stderr] happy [stdout] test [stderr] sentence [stderr] words [stdout] of C:\tmp\node-issue-6249 > node .\translation-party.js 2>&1 | % { "$_" } [stdout] this [stderr] is [stdout] a [stderr] happy [stdout] test [stdout] of [stderr] sentence [stderr] words |
I'm going to reopen this, it might be a real bug. |
I dont think there is actually a way to ensure the streams are in sync unless you ensure between writes that the receiving app has had a processing timeslice and has read its fd. Because the other side might actually poll in reverse/random/unknown order. I might be totally off base. I have been way too far away from the OS these days. |
Having stdout and stderr output in a predictable order qualifies as "really, really important" for something that bothers to make a distinction between stdout and stderr. |
You might want to check this: mapnik/node-mapnik#257 (comment) |
Fixed by nodejs/node@20176a9 a couple years ago. |
When
process.stdout
andprocess.stderr
are not piped, writes to them are output in order, as written. When piped, they are written out-of-order. While there seems to be a workaround for the draining issue in #3584, I can't figure out a workaround for this issue.Given this
translation-party.js
file:In Windows, I see the following behavior.
Can you guys please prioritize fixing these stdio piping issues?
The text was updated successfully, but these errors were encountered: