Skip to content

Commit

Permalink
process: check no handle or request is active after bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Mar 18, 2019
1 parent 470856f commit 6804c0b
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit 6804c0b

Please sign in to comment.