mirror of
https://github.com/denoland/deno.git
synced 2024-11-15 16:43:44 -05:00
5c5f4ea1d6
This panic could happen in the following cases: - A non-fatal error being thrown from a worker, that doesn't terminate the worker's execution, but propagates to the main thread without being handled, and makes the main thread terminate. - A nested worker being alive while its parent worker gets terminated. - A race condition if the main event loop terminates the worker as part of its last task, but the worker doesn't fully terminate before the main event loop stops running. This panic happens because a worker's event loop should have pending ops as long as the worker isn't closed or terminated – but if an event loop finishes running while it has living workers, its associated `WorkerThread` structs will be dropped, closing the channels that keep those ops pending. This change adds a `Drop` implementation to `WorkerThread`, which terminates the worker without waiting for a response. This fixes the panic, and makes it so nested workers are automatically terminated once any of their ancestors is closed or terminated. This change also refactors a worker's termination code into a `WorkerThread::terminate()` method. Closes #11342. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> |
||
---|---|---|
.. | ||
bundle_tests.rs | ||
cache_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 | ||
test_tests.rs | ||
upgrade_tests.rs | ||
watcher_tests.rs | ||
worker_tests.rs |