Skip to content

Commit

Permalink
worker: call CancelTerminateExecution() before exiting Locker
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
addaleax committed May 15, 2020
1 parent c7eeef5 commit dd0980e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/node_worker.cc
Expand Up @@ -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);

Expand Down

0 comments on commit dd0980e

Please sign in to comment.