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

feat(cli): expose a function to kill dev child #6160

Open
wants to merge 3 commits into
base: 1.x
Choose a base branch
from

Conversation

amrbashir
Copy link
Member

@amrbashir amrbashir commented Jan 28, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

Sometimes while using the cli.js API from a JS script, a zombie process is left after killing the JS script using ctrl+c. I can't reproduce it reliably but having an API to kill the dev app process, the script could execute it upon exit:

process.on('SIGTERM', () => killDevApp());
process.on('exit', () => killDevApp());

@amrbashir amrbashir requested a review from a team as a code owner January 28, 2023 02:33
@lucasfernog
Copy link
Member

I think we should try to do it on our end instead. Or maybe the JS script could just listen to ctrl+c and kill the CLI process manually?

@amrbashir
Copy link
Member Author

I think we should try to do it on our end instead.

We could do that in cli.js but we'd still need to expose the function through NAPI

Or maybe the JS script could just listen to ctrl+c and kill the CLI process manually?

Again, we still need to expose a function to kill the process or at least the PID.

@amrbashir amrbashir changed the base branch from dev to 1.x September 9, 2023 22:55
@lucasfernog
Copy link
Member

I still couldn't reproduce the issue :( I actually wanted to listen to the signal on the Rust code and let it handle it instead.

@amrbashir
Copy link
Member Author

Yeah I can't really reproduce it reliably but I think it happens only after you triggered the CLI hot-reload at least once or twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📬Proposal
Development

Successfully merging this pull request may close these issues.

None yet

2 participants