diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-05-11 01:55:29 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-05-15 20:38:23 +0300 |
commit | dd0980ecc287537a48cd5d6f7f803cd8c681dbdb (patch) | |
tree | 0ca87837e3121c68711d22caa17f6ec68ee5a8da /src/node_worker.cc | |
parent | c7eeef568ce5a3714b89689160ec85c017527364 (diff) |
worker: call CancelTerminateExecution() before exiting Locker
As the comment indicates, this fixes a DCHECK failure, although I don’t
quite understand why it is happening in the first place.
PR-URL: https://github.com/nodejs/node/pull/33347
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/node_worker.cc')
-rw-r--r-- | src/node_worker.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index 1e1d9434cdd..fa778166e93 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -260,6 +260,11 @@ void Worker::Run() { DeleteFnPtr<Environment, FreeEnvironment> 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); |