Implemented graceful shutdown and fixed various TUI bugs
This MR introduces a graceful shutdown mechanic, which when initiated begins counting down for the configured grace period, sending a warning message to all connected players every 30 seconds, and then every 1 second in the last 10 seconds of the grace period.
The shutdown can be triggered either by sending veloren-server-cli the
SIGUSR1 signall on Linux, or the
shutdown <seconds> TUI command. The
SIGUSR1 signal was chosen to avoid interfering with
SIGINT which is generated on Ctrl+C on Linux and Windows, and
SIGTERM which still kills the server as expected.
In order for this change to work correctly, the
docker-compose.yml file has had the
--stop-timeout 130s argument added in order to make it wait for the 2 minute grace period + 10 seconds to expire before force killing the server. https://containrrr.dev/watchtower/arguments/#wait_until_timeout
- Implemented graceful shutdown on SIGUSR1 signal.
ShutdownCoordinatormodule to veloren-server-cli
shutdown <seconds>TUI command.
- Fixed a bug in TUI that caused a panic on quit in basic mode on windows.
- Fixed a bug in TUI that meant commands with 1 or more arguments printed an error message in the console
- Moved TUI panic hook to
main.rsfor better visibility
- Added Watchtower LABEL in
server-cli\Dockerfileto configure Watchtower to use
SIGUSR1for shutdowns https://containrrr.dev/watchtower/stop-signals/
--stop-timeout 130sargument to watchtower in
- By opening this merge request, you agree to release your code and all other changes under the GPL 3 license and to abide by the terms set by this license.
- Migrations have been added if applicable
- Significant changes of this merge request have been added to the changelog.