Skip to content

Commit b1a7fda

Browse files
addaleaxcodebytere
authored andcommitted
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: #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]>
1 parent 2dc5db8 commit b1a7fda

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/node_worker.cc

+5
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ void Worker::Run() {
260260

261261
DeleteFnPtr<Environment, FreeEnvironment> env_;
262262
auto cleanup_env = OnScopeLeave([&]() {
263+
// TODO(addaleax): This call is harmless but should not be necessary.
264+
// Figure out why V8 is raising a DCHECK() here without it
265+
// (in test/parallel/test-async-hooks-worker-asyncfn-terminate-4.js).
266+
isolate_->CancelTerminateExecution();
267+
263268
if (!env_) return;
264269
env_->set_can_call_into_js(false);
265270

0 commit comments

Comments
 (0)