Skip to content
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

Investigate process.exit() and node.js termination #25

Open
justus-hildebrand opened this issue Jan 15, 2018 · 1 comment
Open

Investigate process.exit() and node.js termination #25

justus-hildebrand opened this issue Jan 15, 2018 · 1 comment

Comments

@justus-hildebrand
Copy link
Collaborator

justus-hildebrand commented Jan 15, 2018

When process.exit() is called, an exit event seems to be dispatched. To figure out how to properly handle this in our terminate method, we need to understand how this works. Is it added to the event queue? Is the event queue cleared before? Is the event dispatched outside of the event loop?

According to your findings, modify node::lib::Terminate().

@cmfcmf
Copy link
Collaborator

cmfcmf commented Jan 15, 2018

This may be related to

node/src/node.cc

Lines 4863 to 4870 in 7a59273

env.set_trace_sync_io(false);
const int exit_code = EmitExit(&env);
RunAtExit(&env);
uv_key_delete(&thread_local_env);
v8_platform.DrainVMTasks();
WaitForInspectorDisconnect(&env);
, which is not currently called anywhere when using the node::lib functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants