1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00
denoland-deno/cli
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
..
ast fix(cli): better handling of source maps (#11954) 2021-09-08 14:05:34 +10:00
bench bench(deno_common): track new Request() (#12164) 2021-09-21 12:34:27 +02:00
dts fix(cli): move Deno.flock and Deno.funlock to unstable types (#12138) 2021-09-19 14:46:54 +02:00
lsp fix(lsp): align filter text to vscode logic (#12081) 2021-09-16 12:07:52 +10:00
ops fix(cli/fmt_errors): Abbreviate long data URLs in stack traces (#12127) 2021-09-18 15:40:04 +02:00
schemas fix(config-schema): correct default value of "lib" (#12145) 2021-09-20 11:30:00 -04:00
tests fix(workers): Don't panic when a worker's parent thread stops running (#12156) 2021-09-22 18:02:15 +02:00
tools refactor(cli): don't generate a module for side loading tests (#12129) 2021-09-18 16:12:50 +02:00
tsc fix(cli): don't ignore diagnostics about for await (#12116) 2021-09-17 16:54:52 +10:00
auth_tokens.rs feat(cli): Support Basic authentication in DENO_AUTH_TOKENS (#11910) 2021-09-08 06:18:11 +02:00
build.rs fix: move unstable declarations to deno.unstable (#11876) 2021-08-31 11:25:15 +02:00
Cargo.toml 1.14.1 2021-09-22 08:44:46 +10:00
checksum.rs chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
config_file.rs feat(fmt): add support for configuration file (#11944) 2021-09-13 20:19:10 +02:00
deno.ico fix(cli): add icon and metadata to deno.exe on Windows (#6693) 2020-07-15 21:54:38 +02:00
deno_dir.rs chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
diagnostics.rs refactor: Remove duplicated colors.rs file (#11990) 2021-09-12 12:04:17 -04:00
diff.rs refactor: Remove duplicated colors.rs file (#11990) 2021-09-12 12:04:17 -04:00
disk_cache.rs chore: upgrade Rust to 1.54.0 (#11554) 2021-07-30 15:03:41 +02:00
errors.rs refactor: use import_map crate (#11974) 2021-09-11 03:38:24 +02:00
file_fetcher.rs fix(lsp): support data urls in deno.importMap option (#11397) 2021-09-13 09:49:23 +05:30
file_watcher.rs chore: update dependencies (#11856) 2021-09-02 23:38:44 +02:00
flags.rs chore: update tagline (#12095) 2021-09-16 11:55:06 +05:30
flags_allow_net.rs chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
fmt_errors.rs fix(cli/fmt_errors): Abbreviate long data URLs in stack traces (#12127) 2021-09-18 15:40:04 +02:00
fs_util.rs feat(cli): add --ignore flag to test command (#11712) 2021-08-24 17:23:29 +02:00
http_cache.rs fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
http_util.rs feat(fetch): mTLS client certificates for fetch() (#11721) 2021-08-25 14:25:12 +02:00
info.rs refactor: Remove duplicated colors.rs file (#11990) 2021-09-12 12:04:17 -04:00
lockfile.rs remove macro_use (#9884) 2021-03-26 12:34:25 -04:00
logger.rs feat(lsp): add internal debugging logging (#10438) 2021-05-11 14:54:10 +10:00
main.rs fix(core): prevent multiple main module loading (#12128) 2021-09-18 03:44:53 +02:00
module_graph.rs chore: update deno_* crates (#12020) 2021-09-13 10:06:36 +10:00
module_loader.rs refactor: use import_map crate (#11974) 2021-09-11 03:38:24 +02:00
program_state.rs refactor: use import_map crate (#11974) 2021-09-11 03:38:24 +02:00
README.md Remove deno_typescript (#6813) 2020-07-20 19:49:57 -04:00
source_maps.rs feat: blob URL support (#10045) 2021-04-07 15:22:14 +02:00
specifier_handler.rs refactor(lsp): use deno_ast and cache swc ASTs (#11780) 2021-09-07 10:39:32 -04:00
standalone.rs fix(core): prevent multiple main module loading (#12128) 2021-09-18 03:44:53 +02:00
text_encoding.rs fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
tokio_util.rs feat: native HTTP bindings (#9935) 2021-04-08 18:34:15 -04:00
tsc.rs refactor(lsp): use deno_ast and cache swc ASTs (#11780) 2021-09-07 10:39:32 -04:00
unix_util.rs chore: update copyright headers (#10243) 2021-04-20 14:27:36 +09:00
version.rs Remove denort optimization (#10350) 2021-04-26 13:28:38 -04:00

Deno CLI Crate

crates docs

This provides the actual deno executable and the user-facing APIs.

The deno crate uses the deno_core to provide the executable.