From 4a13c320d73b1d8a0da18effa81199ab2ea8ef55 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 29 Nov 2021 13:37:44 +0100 Subject: fix(workers): Make `worker.terminate()` not immediately kill the isolate (#12831) Due to a bug in V8, terminating an isolate while a module with top-level await is being evaluated would crash the process. This change makes it so calling `worker.terminate()` will signal the worker to terminate at the next iteration of the event loop, and it schedules a proper termination of the worker's isolate after 2 seconds. --- cli/tests/integration/worker_tests.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/worker_tests.rs b/cli/tests/integration/worker_tests.rs index c17b63af9..8bb051ff3 100644 --- a/cli/tests/integration/worker_tests.rs +++ b/cli/tests/integration/worker_tests.rs @@ -99,3 +99,8 @@ itest!(worker_permissions_blob_local { http_server: true, exit_code: 1, }); + +itest!(worker_terminate_tla_crash { + args: "run --quiet --reload workers/terminate_tla_crash.js", + output: "workers/terminate_tla_crash.js.out", +}); -- cgit v1.2.3