From 899de0a7c722c411dad1868cce93a3412882e5f2 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 11 Mar 2019 23:52:47 +0800 Subject: [PATCH] process: check no handle or request is active after bootstrap PR-URL: https://github.com/nodejs/node/pull/26593 Reviewed-By: Gus Caplan Reviewed-By: James M Snell --- src/node.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/node.cc b/src/node.cc index fe28a8a2004761..9494cc11078a31 100644 --- a/src/node.cc +++ b/src/node.cc @@ -360,6 +360,12 @@ 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 handles/requests before aborting + CHECK(env->req_wrap_queue()->IsEmpty()); + CHECK(env->handle_wrap_queue()->IsEmpty()); + env->set_has_run_bootstrapping_code(true); return scope.EscapeMaybe(result);