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

(local) ensure shutdown cannot be run repeatedly #146

Merged
merged 1 commit into from
May 30, 2024

Conversation

joewagner
Copy link
Contributor

I've been getting an error recently where the SIGINT event is being received twice by local tableland.

After some debugging, it looks like when Ctrl+C is pressed, the shell sends a SIGINT signal to the foreground process/process-group. If the foreground process is Node, it's only sent to the Node process. But when it's an npm process with a child Node process attached, the SIGINT is sent to both npm and Node processes.
The Node process receives the signal a second time is because the npm process listens to signals and relays them to the child Node process.

This change ensures that an instance of LT will not try to shutdown twice in parallel if the signal is received twice.

@joewagner joewagner marked this pull request as ready for review May 29, 2024 23:59
Copy link
Member

@carsonfarmer carsonfarmer left a comment

Choose a reason for hiding this comment

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

Nice catch!

@joewagner joewagner merged commit f9f56a3 into main May 30, 2024
4 checks passed
@joewagner joewagner deleted the joe/local-fix-shutdown branch May 30, 2024 20:56
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.

2 participants