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

process: check no handle or request is active after bootstrap #26593

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
process: check no handle or request is active after bootstrap
  • Loading branch information
joyeecheung committed Mar 18, 2019
commit 6804c0bc0a4c7a35b5a0c3f21fb62d1734d5a84d
11 changes: 11 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,17 @@ MaybeLocal<Value> RunBootstrapping(Environment* env) {
.IsNothing())
return MaybeLocal<Value>();

// Make sure that no request or handle is created during bootstrap -
// if necessary those should be done in pre-exeuction.
// TODO(joyeecheung): print requests before aborting
if (env->event_loop()->active_handles > 0) {
PrintLibuvHandleInformation(env->event_loop(), stderr);
CHECK_EQ(env->event_loop()->active_handles, 0);
}
CHECK(env->req_wrap_queue()->IsEmpty());
CHECK(env->handle_wrap_queue()->IsEmpty());
CHECK_EQ(env->event_loop()->active_reqs.count, 0);

env->set_has_run_bootstrapping_code(true);

return scope.EscapeMaybe(result);
Expand Down