sentium
sentium copied to clipboard
Graceful shutdown
To ensure data consistency we need to intercept terminations signals and finish serving any in-flight requests and close connections to the DB before shutting down. This is very likely to require changes to gRPCxx.
Requirements
- Intercept termination signals (
SIGTERM,SIGINT,SIGQUIT) and;- Stop accepting any further incoming requests after the termination signal
- Finish serving any in-flight requests
- Close DB connection
- Shutdown gracefully
https://github.com/uatuko/grpcxx/pull/42 should introduce a way to signal the grpc socket to shutdown using a std::stop_token.