Skip to content
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(runtime): Restore default signal handler after user handlers are unregistered #22757

Merged
merged 7 commits into from
Mar 11, 2024

Conversation

nathanwhit
Copy link
Member

@nathanwhit nathanwhit commented Mar 6, 2024

Fixes #22724. Fixes #7164.

This does add a dependency on signal-hook, but it's just a higher level API on top of signal-hook-registry (which we and tokio already depend on) and doesn't add any transitive deps.

@nathanwhit nathanwhit requested a review from mmastrac March 6, 2024 22:40
@bartlomieju
Copy link
Member

I believe this also fixes a long standing issue: #7164

Copy link
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great fix.

runtime/ops/signal.rs Outdated Show resolved Hide resolved
@@ -237,6 +237,7 @@ Deno.test({

Deno.test({
name: "process.off signal",
ignore: Deno.build.os == "windows",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

LGTM, do we have an issue for process.off not working on Windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dug a little deeper on this, turns out it's a process.off issue, it's a more general signal sending issue on windows (#22846)

@nathanwhit nathanwhit merged commit 28b362a into denoland:main Mar 11, 2024
17 checks passed
@nathanwhit nathanwhit deleted the default-signal-handler branch March 11, 2024 17:22
nathanwhit added a commit that referenced this pull request Mar 14, 2024
…unregistered (#22757)

<!--
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 #22724. Fixes #7164.

This does add a dependency on `signal-hook`, but it's just a higher
level API on top of `signal-hook-registry` (which we and `tokio` already
depend on) and doesn't add any transitive deps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants