1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-22 06:09:25 -05:00
denoland-deno/cli
Andreu Botella b7c2902c97
Don't drop messages from workers that have already been closed (#11913)
When `worker.terminate()` is called, the spec requires that the
corresponding port message queue is emptied, so no messages can be
received after the call, even if they were sent from the worker before
it was terminated.

The spec doesn't require this of `self.close()`, and since Deno uses
different channels to send messages and to notify that the worker was
closed, messages might still arrive after the worker is known to be
closed, which are currently being dropped. This change fixes that.

The fix involves two parts: one on the JS side and one on the Rust side.
The JS side was using the `#terminated` flag to keep track of whether
the worker is known to be closed, without distinguishing whether further
messages should be dropped or not. This PR changes that flag to an
enum `#state`, which can be one of `"RUNNING"`, `"CLOSED"` or
`"TERMINATED"`.

The Rust side was removing the `WorkerThread` struct from the workers
table when a close control was received, regardless of whether there
were any messages left to read, which made any subsequent calls to
`op_host_recv_message` to return `Ok(None)`, as if there were no more
mesasges. This change instead waits for both a close control and for
the message channel's sender to be closed before the worker thread is
removed from the table.
2021-09-06 11:05:02 +02:00
..
ast fix: parse error when transpiling code with BOM (#11688) 2021-08-16 09:28:29 +02:00
bench chore(std/http): server module name migration (#11890) 2021-09-05 22:43:46 +02:00
dts feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
lsp fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
ops refactor(cli): introduce module specifier test modes (#11769) 2021-08-26 21:21:58 +02:00
schemas fix(cli): info now displays type reference deps (#11478) 2021-07-22 15:34:28 +10:00
tests Don't drop messages from workers that have already been closed (#11913) 2021-09-06 11:05:02 +02:00
tools fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
tsc feat(cli): Update to TypeScript 4.4 (#11678) 2021-08-27 10:12:59 +10:00
auth_tokens.rs remove macro_use (#9884) 2021-03-26 12:34:25 -04:00
build.rs fix: move unstable declarations to deno.unstable (#11876) 2021-08-31 11:25:15 +02:00
Cargo.toml feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
checksum.rs chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
colors.rs Remove denort optimization (#10350) 2021-04-26 13:28:38 -04:00
config_file.rs feat(lint): add support for config file and CLI flags for rules (#11776) 2021-09-03 17:01:58 +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 feat: ffi to replace plugins (#11152) 2021-08-06 23:28:10 +02:00
diff.rs fix(diff): better handling of text with only line ending differences (#11212) 2021-07-02 10:16:09 -04:00
disk_cache.rs chore: upgrade Rust to 1.54.0 (#11554) 2021-07-30 15:03:41 +02:00
errors.rs refactor(ast): Change AST parsing error to return struct with message and location (#10911) 2021-06-11 09:03:42 -04:00
file_fetcher.rs chore: upgrade crates (#11894) 2021-09-02 17:38:19 +02:00
file_watcher.rs chore: update dependencies (#11856) 2021-09-02 23:38:44 +02:00
flags.rs refactor: factor out DenoSubcommand enum variant into structs (#11896) 2021-09-04 01:33:35 +02:00
flags_allow_net.rs chore: update copyright to 2021 (#9092) 2021-01-11 18:13:41 +01:00
fmt_errors.rs chore: upgrade Rust to 1.54.0 (#11554) 2021-07-30 15:03:41 +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
import_map.rs fix(doc): fix rustdoc bare_urls warning (#11921) 2021-09-05 16:22:45 +02:00
info.rs fix(cli): info now displays type reference deps (#11478) 2021-07-22 15:34:28 +10: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 refactor: factor out DenoSubcommand enum variant into structs (#11896) 2021-09-04 01:33:35 +02:00
media_type.rs fix(#10815): lsp only responds to formatting for md, json, jsonc (#10816) 2021-06-02 20:29:58 +10:00
module_graph.rs feat(cli): Update to TypeScript 4.4 (#11678) 2021-08-27 10:12:59 +10:00
module_loader.rs fix(cli): Don't statically error on dynamic unmapped bare specifiers (#10618) 2021-05-31 16:37:36 +02:00
program_state.rs fix: correct spelling of certificate in --unsafely-ignore-certificate-errors warning message (#11634) 2021-08-10 12:47:44 -04: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 chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
standalone.rs feat(runtime): support classic workers for internal testing (#11338) 2021-08-16 14:29:54 +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 fix: move unstable declarations to deno.unstable (#11876) 2021-08-31 11:25:15 +02: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.