fix: exit GUI and mini mode when the server shuts down on SIGTERM - #270
Merged
Merged
Conversation
Rocket handles SIGINT/SIGTERM (and SIGHUP on Unix) by shutting the server down gracefully. Daemon mode then stops the modules and exits, but GUI mode dropped the launch handle and mini mode ignored a clean shutdown, so the process and its modules kept running without a server. Only the tray's Quit, or SIGKILL, ended them. Watch the Rocket task in both modes: once it finishes, stop the modules and exit, with code 1 if the server failed. In mini mode, SIGTERM now exits with code 0 after about 7s (Rocket's shutdown grace period), and all modules are gone; before, it was still running 15s later.
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On SIGINT/SIGTERM (and SIGHUP on Unix), Rocket shuts the server down gracefully. Daemon mode then stops the modules and exits. GUI mode drops the launch handle, though, and mini mode ignores a clean shutdown. The process and its modules keep running without a server, and only the tray's Quit or SIGKILL ends them.
This watches the Rocket task in both modes. Once it finishes, they stop the modules and exit, with code 1 if the server failed.
GUI mode now also exits if the server fails. Before, it stayed open with a dead dashboard; mini and daemon mode already exited.
Testing
--testingwith real modules, sending SIGTERM:cargo fmt --checkandcargo clippy --all-targets -D warningspass.