diff --git a/src/node.cc b/src/node.cc index 783962d192f5f0..779ad624e195f2 100644 --- a/src/node.cc +++ b/src/node.cc @@ -358,6 +358,17 @@ MaybeLocal RunBootstrapping(Environment* env) { .IsNothing()) return MaybeLocal(); + // 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);