Closed MarkMcCulloh closed 2 weeks ago
Thanks for opening this pull request! :tada: Please consult the contributing guidelines for details on how to contribute to this project. If you need any assistence, don't hesitate to ping the relevant owner over Slack.
Topic | Owner |
---|---|
Wing SDK and utility APIs | @chriscbr |
Wing Console | @ainvoner , @skyrpex , @polamoros |
JSON, structs, primitives and collections | @hasanaburayyan |
Platforms and plugins | @hasanaburayyan |
Frontend resources (website, react, etc) | @tsuf239 |
Language design | @chriscbr |
VSCode extension and language server | @markmcculloh |
Compiler architecture, inflights, lifting | @yoav-steinberg |
Wing Testing Framework | @tsuf239 |
Wing CLI | @markmcculloh |
Build system, dev environment, releases | @markmcculloh |
Library Ecosystem | @chriscbr |
Documentation | @hasanaburayyan |
SDK test suite | @tsuf239 |
Examples | @hasanaburayyan |
Wing Playground | @eladcon |
Thanks for contributing, @MarkMcCulloh! This PR will now be added to the merge queue, or immediately merged if mark/multiple-signals-break
is up-to-date with main
and the queue is empty.
Congrats! :rocket: This was released in Wing 0.73.10.
Finally was able to reproduce the issue locally. Depending on how it is executed, it is possible the CLI will receive multiple SIGINT signals when a user hits CTRL^C (even when pressed once).
Using process.once handled the first signal and then started our cleanup process. However, the second signal came along and no longer had a handler because the first process.once was used up. So then node returns to its default behavior, which is to immediately process.exit(). process.exit() Stops the process kills the process without waiting for the event loop to finish so thus the cleanup process is interrupted.
Other changes:
exit
handling because that does not allow us to schedule any additional async work, so it's pointlessReproducing: I noticed this happening with a globally installed version of the CLI, but no with my local dev version. So to test this fix, I manually replaced the compiled .js for this particular util file in the global version. I do not know why this only happens with the global version.
By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.