-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
process.stdout not blocking in node v6.0.0? #6409
Comments
process.stdout has never been blocking. This is (and has been) a known thing for a while but it's been put a bit more front and center because of a recent update in libuv. Essentially the issue lies with how There are a couple of approaches to work around it but the main approach is to not call The issue is not unlike spinning up work in multiple threads then not waiting for those to complete before exiting the process. Work gets lost. |
@jasnell Hmm, interesting. I figured this was a bit of a bad idea anyway. I suppose I need to remove this functionality. Is there no way to detect once stdout has been flushed? |
Will close this as it's an issue with my program, not Node 😄 |
I am opening a PR to clarify the documentation around |
I wrote a config loader called milieu which has a feature that prints a table displaying the key, value, and value of all the config value. Here's an example from Node v5.5.0:
I upgraded to Node v6.0.0 and noticed that this table now looks like this:
When the library detects a
--explain-config
flag it prints the table and exits the program. Below is a snippet of code from the library that does the former.Basically the
printExplainTable
method prints the tabletowithprocess.stdout
console.log
. The idea here was that stdout would block until the table is printed to the shell, thenprocess.exit(0)
is called to stop the server/program from starting.It seems that stdout no longer blocks. If stdout does not block, is there a method to know when the stdout has been flushed? I tried using the
'drain'
event the the stdout stream, but that doesn't seem to fire.Seems like a bug. Any thoughts?
The text was updated successfully, but these errors were encountered: