Refactoring: always kill AOF/RDB child via helper functions.

This commit is contained in:
antirez
2019-01-21 11:28:44 +01:00
parent 5f42bfce05
commit 4dc69497f5
6 changed files with 17 additions and 14 deletions

View File

@ -2225,6 +2225,16 @@ void backgroundSaveDoneHandler(int exitcode, int bysignal) {
}
}
/* Kill the RDB saving child using SIGUSR1 (so that the parent will know
* the child did not exit for an error, but because we wanted), and performs
* the cleanup needed. */
void killRDBChild(void) {
kill(server.rdb_child_pid,SIGUSR1);
rdbRemoveTempFile(server.rdb_child_pid);
closeChildInfoPipe();
updateDictResizePolicy();
}
/* Spawn an RDB child that writes the RDB to the sockets of the slaves
* that are currently in SLAVE_STATE_WAIT_BGSAVE_START state. */
int rdbSaveToSlavesSockets(rdbSaveInfo *rsi) {