-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apollo-server-core: Improve SIGINT/SIGTERM handling
Two improvements to the SIGINT and SIGTERM signal handlers that are installed by default in non-test mode if you don't pass `stopOnTerminationSignals: false`. - If another SIGINT or SIGTERM is recieved while awaiting `stop()`, ignore it (ie, prevent the process from exiting if this was the only handler for that signal). This is implemented by switching the `process.once` to `process.on` and explicitly tracking if a signal has been received. Fixes #4931. - If `await this.stop()` throws, make sure to shut down the process anyway after logging. This does `process.exit(1)` instead of re-signaling because it can't be sure that the signal handler has been removed.
- Loading branch information
Showing
3 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters