-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Stdout output is not completely flushed upon process exit. #8329
Comments
This issue hits the Emscripten compiler, see the following: |
Tested that this occurs in node.js v0.10.31. Based on the experience from running unit test bot farm on Windows, Linux and OSX, it looks like that this is a Windows-only bug at this point. |
Currently the best workaround we have found is this set of commits: |
If you're using console.log output is async, and buffered, which may not flush before exit... warn/error are not async/buffered.. It may be disirable to flush the output... I usially wrap my process exits in a process.nextTick to avoid/reduce the issue. |
Hello, this is not a windows-only issue. I have the problem on linux with foreman. This was reported using foreman for another user : ddollar/foreman#440 (see the proposed solution wich is no longer usable) This problem has triggered using the creation of dedicated modules : https://www.npmjs.org/package/exit (it Hope this helps... |
What is the status of this bug? #3584 makes me believe this was fixed, but the conversation is quite long with fixes merged and unmerged along the way. What is the final status? If this issue is fixed, what version is the fix merged into? And should this issue be closed? |
I believe the issue still exists. I ran into it about 5 months ago, and I haven't found a set of commits since then that would have fixed it. |
I can confirm I was having this issue on windows with nodejs v0.10.32 and this issue has now gone with v0.12.2 :) |
@misterdjules ... are you familiar with this one? Wondering if this is one we should backport to v0.10 |
This affects me on 0.12.6 and has for some time. It's pretty irritating, makes it complicated to dump large objects and exit, and can screw up the prompt from the result of a test reporter with long output that gets interrupted before it can reset colors. |
FYI: for those interested, if you use console.error, the output gets serialized... I also notice if I do a |
We just upgraded our codebase from node 0.10.40 to 0.12.7. We dump a large JSON structure to stdout on a TTY, and in some cases a python-expect script doing validation tries to grab that (yes, I know, I know). While things were stable and worked 100% reliably on 0.10.40, this has regressed exactly as described above by @myndzi and @tracker1 in 0.12.7. I should say we're using Linux. |
Just came across what seems to be the same issue when testing remarkable. Occurs with 0.12.10 and 5.7.1. Piping into cat displays full output while displaying direct to a tty almost always truncates. |
Anyone else getting this on node 4.x.x? |
I am closing this in favor for nodejs/node#6456 and a respective PR nodejs/node#6773. The issue is very complex, widespread, not very clear defined and we are working on a fix / feature addition to aid this. |
I've tried to follow the trail of existing issues in the tracker to deduce whether this is still actively tracked/reported, but was not quite able to. The issues #1669, #3584, #3479, #5275 all relate to this, but are either closed or not exactly this one, so I'm reporting this as a new issue.
If the output of node.js is piped to another application, then the receiving application might not get the whole output when node.js terminates.
Steps to repro:
Observed: The printed output differs on the two cases printed by the test, i.e. the second case does not print "Line 2".
Expected: The output should read identical result in both cases, i.e. "Line 2" should be printed out on the second run as well.
The text was updated successfully, but these errors were encountered: