sentium icon indicating copy to clipboard operation
sentium copied to clipboard

Graceful shutdown

Open uatuko opened this issue 1 year ago • 1 comments

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

  1. Intercept termination signals (SIGTERM, SIGINT, SIGQUIT) and;
    1. Stop accepting any further incoming requests after the termination signal
    2. Finish serving any in-flight requests
    3. Close DB connection
    4. Shutdown gracefully

uatuko avatar May 01 '24 10:05 uatuko

https://github.com/uatuko/grpcxx/pull/42 should introduce a way to signal the grpc socket to shutdown using a std::stop_token.

uatuko avatar Oct 31 '24 08:10 uatuko