1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-15 16:43:44 -05:00
denoland-deno/cli/tests/integration
Andreu Botella 5c5f4ea1d6
fix(workers): Don't panic when a worker's parent thread stops running (#12156)
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>
2021-09-22 18:02:15 +02:00
..
bundle_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
cache_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
compile_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
coverage_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
doc_tests.rs fix(cli): deno doc panics on invalid url (#11536) 2021-07-29 04:07:25 -07:00
eval_tests.rs chore: split up integration_tests.rs into separate files (#11131) 2021-06-27 13:27:36 -04:00
fmt_tests.rs feat(fmt): add support for configuration file (#11944) 2021-09-13 20:19:10 +02:00
info_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
inspector_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
install_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
lint_tests.rs feat(lint): add support for config file and CLI flags for rules (#11776) 2021-09-03 17:01:58 +02:00
lsp_tests.rs chore(lsp): use pretty_assertions in e2e tests (#12083) 2021-09-15 16:04:17 +05:30
mod.rs feat(cli): Support Basic authentication in DENO_AUTH_TOKENS (#11910) 2021-09-08 06:18:11 +02:00
repl_tests.rs chore(tests): windows pty tests (#12091) 2021-09-20 22:15:44 -04:00
run_tests.rs fix(workers): Don't panic when a worker's parent thread stops running (#12156) 2021-09-22 18:02:15 +02:00
test_tests.rs feat(cli): close test worker once all tests complete (#11727) 2021-09-04 20:19:26 +02:00
upgrade_tests.rs fix(cli/tools/upgrade): check if passed version is valid (#11296) 2021-07-07 14:59:39 -04:00
watcher_tests.rs fix(cli): dispatch unload event on watch drop (#11696) 2021-08-24 22:34:09 +02:00
worker_tests.rs chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00