-
Notifications
You must be signed in to change notification settings - Fork 285
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
Node keeps running, resp. exits slowly with empty process._getActiveRequests()
or process._getActiveHandles()
#2823
Comments
If the wasm file is big, it's possible V8 is still busy compiling it in the background. That would square with the v10-vs-v12 behavior you're seeing, asynchronous compilation of WASM is relatively new. An easy way to verify that hypothesis is to start node with |
|
I am seeing the same issue when doing this:
Seems to be about a 5 or 6 second delay between seeing "done" and process termination. |
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
I'm part of the team developing the solidity compiler. We release emscripten compiled binaries that can be used via node-js.
Recently we got reports of surprising behavior of node-js, which I can reproduce, but could use help in fixing.
An example of an affected compiler binary can be found here:
https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/soljson-v0.6.10%2Bcommit.00c0fcaf.js
The issue can be observed with a simple script like
With node 10 the actual
require
takes a long time, but once it returns, node exits quickly.Starting from node 12 (actually some versions of node 11 appear to behave the same already), the
require
is fast, but node takes several seconds to exit.After the
require
,process._getActiveRequests()
is empty.process._getActiveHandles()
contains the following, but IIUC this is just stdio and shouldn't prevent the exit, right?soljson.js
itself contains an emscripten build with embedded wasm that is loaded synchronously. No I/O from or to stdin/stdout should be performed in it. Immediately after therequire
all entry points seem to be available and working - we have no notion of what we might cause that would prevent node from exiting.Calling either
process.exit()
orabort()
after therequire
causes node to exit immediately, which hints me athttps://nodejs.org/api/process.html#process_process_exit_code
"Calling process.exit() will force the process to exit as quickly as possible even if there are still asynchronous operations pending that have not yet completed fully, including I/O operations to process.stdout and process.stderr."
Is there any other way than examining
process._getActiveRequests()
andprocess._getActiveHandles()
to check for pending asynchronous operations or I/O operations? I'm not aware of any such operationssoljson.js
could cause, though. Is there any other reason whynode
could behave like this or can you provide any further help to debug this?Thank you very much for your help!
The text was updated successfully, but these errors were encountered: