-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ext/web): fix AbortSignal.timeout()
leak
#23842
fix(ext/web): fix AbortSignal.timeout()
leak
#23842
Conversation
#20663 is saying that a test like this should pass. Deno.test({
name: "regression for #20663",
fn: () => {
AbortSignal.timeout(2000);
},
}); |
ext/web/03_abort_signal.js
Outdated
@@ -120,6 +120,7 @@ class AbortSignal extends EventTarget { | |||
const signal = new AbortSignal(illegalConstructorKey); | |||
signal[timerId] = setTimeout( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that Deno.core offers a queueSystemTimer
to work around this sort of issue. Even with the changes made here, we will still be leaking a timer, as the timer is only ever cleared when the timer has fired (which should have already cleared the timer).
tests/unit/timers_test.ts
Outdated
name: "regression for #20663", | ||
fn: async () => { | ||
const signal = AbortSignal.timeout(2000); | ||
const t = setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To properly test this fix, I believe you should create an AbortSignal.timeout and let it just leak out of the test.
AbortSignal.timeout()
leak
Thanks for the |
[patch.crates-io] | ||
deno_core = { git = "https://github.com/denoland/deno_core" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this before merging. My mistake.
A PR was landed by mistake that used `[patch.crates-io]` instead of released `deno_core` version: #23842 (comment)
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Fixes #20663. --------- Co-authored-by: Asher Gomez <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
A PR was landed by mistake that used `[patch.crates-io]` instead of released `deno_core` version: #23842 (comment)
<!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix denoland#7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> Fixes denoland#20663. --------- Co-authored-by: Asher Gomez <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
A PR was landed by mistake that used `[patch.crates-io]` instead of released `deno_core` version: denoland#23842 (comment)
Fixes #20663.