You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DrainVMTasks() has something to do with V8 internals, but since we run uv_run with UV_RUN_ONCE instead of UV_RUN_DEFAULT, it should get called way more often than it used to. I am not quite sure of the implications of this just yet, but I am looking into it right now. Seems to be a pretty deep rabbit hole...
According to this commit, PR with discussion here, DrainVMTasks() is called to handle outstanding V8 threads/tasks that might still exist while node is already shutting down. Apparently, without draining the tasks, UV could think there are no more events and shut down node, eventhough there may still be events that would get queued by V8 later.
For us, I propose a 3rd call to uv_loop_alive() (and returning if true) before calling DrainVMTasks(), to check if there are more UV events pending before draining the VM, which in theory may take rather long under the right circumstances.
When making TickEventLoop configurable (Issue #36) this call may also be protected with a if (mode != UV_RUN_DEFAULT), as it is obsolete in that case.
Carefully review what each function does in our
TickEventLoop
implementation and if we correctly set themore
variable:node/src/node.cc
Lines 4802 to 4818 in 2fae0db
The text was updated successfully, but these errors were encountered: