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 ctrl-c handling #2200

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Fix ctrl-c handling #2200

merged 1 commit into from
Feb 4, 2025

Conversation

coolreader18
Copy link
Collaborator

@coolreader18 coolreader18 commented Feb 3, 2025

Description of Changes

Uses exec on unix and SetConsoleCtrlHandler on windows. This should fix issues where ctrl-C didn't properly shut down the server or left an orphan process behind. Fixes #2133.

Expected complexity level and risk

2

Testing

  • I've verified that ctrl-C goes straight to the server process on unix.
  • Haven't tested on windows, but this is what rustup and cargo use to avoid this phenomenon, but if the reviewer wants to they could test on windows (or request that I do).

@bfops
Copy link
Collaborator

bfops commented Feb 4, 2025

This PR looks good to me, thank you!

We should confirm on Windows. I'm working on setting up a Windows machine that the team can use for testing things. Once it's set up, I'll send you the details. (If you already have access to a Windows machine that is already set up with the SpacetimeDB repo, you can test this on there without waiting for me though).

@coolreader18
Copy link
Collaborator Author

Well, I can't repro the issue, but I can confirm the issue isn't happening with this patch. :P

@coolreader18
Copy link
Collaborator Author

also to note: iirc, this is an entirely hypothetical issue on windows, I don't believe we've gotten any actual reports of this.

Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

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

Sounds good to me!

@coolreader18 coolreader18 added this pull request to the merge queue Feb 4, 2025
Merged via the queue into master with commit fbb5c9e Feb 4, 2025
13 checks passed
@coolreader18 coolreader18 deleted the noa/fix-ctrl-c branch February 11, 2025 02:51
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.

Signal handling
2 participants