When stopping the server with CTRL+C/SIGINT, Chain immediately quits but the server process is still running gracefully shuttind down.
Expected behavior
Whether the server stops via a stop command or the CTRL+C/SIGINT signal, Chain should always wait for the server process to go through its shutdown process first before exiting.
Describe the bug
Currently there is no proper "graceful shutdown"/"cleanup" process, the server is executed using the tokio's
process::Command
.https://github.com/zeke-io/chain/blob/81ce70eb35c5666d89932c3c6c17ba23e7ce09c9/crates/chain/src/runtime.rs#L85-L100
When stopping the server with
CTRL+C
/SIGINT
, Chain immediately quits but the server process is still running gracefully shuttind down.Expected behavior
Whether the server stops via a stop command or the
CTRL+C
/SIGINT
signal, Chain should always wait for the server process to go through its shutdown process first before exiting.Steps to reproduce
chain run
CTRL+C
to quit