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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: David Carlier <[email protected]>
  • Loading branch information
addaleax authored and codebytere committed Jun 9, 2020
1 parent c129e88 commit 8a92698
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/node_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,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);
Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_,
Expand Down

0 comments on commit 8a92698

Please sign in to comment.