uatuko / ruek

🔐 Lightning fast, global scale authorization service without the overhead of a yet another DSL.
Apache License 2.0
95 stars 7 forks source link

Graceful shutdown #97

Open uatuko opened 7 months ago

uatuko commented 7 months ago

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 commented 1 month ago

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