mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
ba799b6729
Calling `worker.terminate()` used to kill the worker's isolate and then block until the worker's thread finished. This blocks the calling thread if the worker's event loop was blocked in a sync op (as with `Deno.sleepSync`), which wasn't realized at the time, but since the worker's isolate was killed at that moment, it would not block the calling thread if the worker was in a JS endless loop. However, in #12831, in order to work around a V8 bug, worker termination was changed to first set a signal to let the worker event loop know that termination has been requested, and only kill the isolate if the event loop has not finished after 2 seconds. However, this change kept the blocking, which meant that JS endless loops in the worker now blocked the parent for 2 seconds. As it turns out, after #12831 it is fine to signal termination and even kill the worker's isolate without waiting for the thread to finish, so this change does that. However, that might leave the async ops that receive messages and control data from the worker pending after `worker.terminate()`, which leads to odd results from the op sanitizer. Therefore, we set up a `CancelHandler` to cancel those ops when the worker is terminated. |
||
---|---|---|
.. | ||
bench_tests.rs | ||
bundle_tests.rs | ||
cache_tests.rs | ||
check_tests.rs | ||
compat_tests.rs | ||
compile_tests.rs | ||
coverage_tests.rs | ||
doc_tests.rs | ||
eval_tests.rs | ||
fmt_tests.rs | ||
info_tests.rs | ||
inspector_tests.rs | ||
install_tests.rs | ||
lint_tests.rs | ||
lsp_tests.rs | ||
mod.rs | ||
repl_tests.rs | ||
run_tests.rs | ||
task_tests.rs | ||
test_tests.rs | ||
upgrade_tests.rs | ||
vendor_tests.rs | ||
watcher_tests.rs | ||
worker_tests.rs |