-
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
console.log / console.error are supposedly synchronous, but huge amounts of trailing data can be lost on process.exit #7743
Comments
I believe the changes made were only for OS X. /cc @Fishrock123 |
@nodejs/ctc and here's another report on why we definitely need to do #6816 ... |
Refs: nodejs#1771 Refs: nodejs#6456 Refs: nodejs#6773 Refs: nodejs#7743 PR-URL: nodejs#6816
Refs: #1771 Refs: #6456 Refs: #6773 Refs: #7743 PR-URL: #6816 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Saúl Ibarra Corretgé <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: #1771 Refs: #6456 Refs: #6773 Refs: #7743 PR-URL: #6816 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Saúl Ibarra Corretgé <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
This seems to be due to a node issue: nodejs/node#7743
Since #6816 was closed, I believe this is now also solved. |
I'm still getting this issue on node 10.9.0 |
pinging @graingert |
Hello @buckles1170 and thank you for the report. |
We're running on gitlab CI with the node:10 docker image, I can't repeat it locally. I've not configured anything like NODE_TTY_UNSAFE_ASYNC |
@graingert, my guess is that running in a CI has STDOUT and STDERR piped into files (or even something more complex), so they are not TTY, and |
This is running under npm run, and I get the little message from npm too |
I read on various sites that
console.log
is supposed to be synchronous in recent node.js versions. I just want to write a simple application that writes things to the terminal and exits.However, as you can see with this simple example, huge amounts of output can be missing when simply using
console.log
and exiting:If you run it multiple times, you'll also get very random cutoffs for the
stdout
data. That goes completely against my expectations of a supposedly synchronous function..How can console.log be used for safe output that actually arrives even when exiting the program? I would do a flush before exit, if I knew how..
The text was updated successfully, but these errors were encountered: