Skip to content

Conversation

@mbostock
Copy link
Member

Fixes #1459. The main things here are:

  • Don’t try to record another signal if we’re already exiting
  • Use process.kill instead of process.exit to ensure equivalence with default handler
  • (Which requires using process.off to remove our handler before killing)

I also used Promise.race to simplify the code slightly.

@mbostock mbostock requested a review from visnup June 13, 2024 16:32
@mbostock mbostock enabled auto-merge (squash) June 13, 2024 16:43
@mbostock mbostock force-pushed the mbostock/fix-signal-kill branch from e840f32 to 7c5b720 Compare June 13, 2024 17:00
Copy link
Member

@visnup visnup left a comment

Choose a reason for hiding this comment

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

Tested locally in terminal with INT, HUP, and TERM and matches previous behavior. Thanks!

@mbostock mbostock merged commit 44c5be9 into main Jun 13, 2024
@mbostock mbostock deleted the mbostock/fix-signal-kill branch June 13, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error after stopping the dev server when run in an npm workspace

3 participants