diff --git a/src/node_worker.cc b/src/node_worker.cc index 1e1d9434cddb4c..fa778166e9377e 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -260,6 +260,11 @@ void Worker::Run() { DeleteFnPtr env_; auto cleanup_env = OnScopeLeave([&]() { + // TODO(addaleax): This call is harmless but should not be necessary. + // Figure out why V8 is raising a DCHECK() here without it + // (in test/parallel/test-async-hooks-worker-asyncfn-terminate-4.js). + isolate_->CancelTerminateExecution(); + if (!env_) return; env_->set_can_call_into_js(false);