mirror of
https://github.com/fluencelabs/redis
synced 2025-06-23 05:51:34 +00:00
Use libsystemd's sd_notify for communicating redis status to systemd
Instead of replicating a subset of libsystemd's sd_notify(3) internally, use the dynamic library provided by systemd to communicate with the service manager. When systemd supervision was auto-detected or configured, communicate the actual server status (i.e. "Loading dataset", "Waiting for master<->replica sync") to systemd, instead of declaring readiness right after initializing the server process.
This commit is contained in:
committed by
max ulidtko
parent
45025713a8
commit
641c64ada1
@ -1665,6 +1665,11 @@ void readSyncBulkPayload(connection *conn) {
|
||||
if (server.repl_backlog == NULL) createReplicationBacklog();
|
||||
serverLog(LL_NOTICE, "MASTER <-> REPLICA sync: Finished with success");
|
||||
|
||||
if (server.supervised_mode == SUPERVISED_SYSTEMD) {
|
||||
redisCommunicateSystemd("STATUS=MASTER <-> REPLICA sync: Finished with success. Ready to accept connections.\n");
|
||||
redisCommunicateSystemd("READY=1\n");
|
||||
}
|
||||
|
||||
/* Restart the AOF subsystem now that we finished the sync. This
|
||||
* will trigger an AOF rewrite, and when done will start appending
|
||||
* to the new file. */
|
||||
|
Reference in New Issue
Block a user