Fix child info pipe fd leak when child process gets killed.

This commit is contained in:
WuYunlong 2019-01-21 17:48:45 +08:00
parent 81008bf99e
commit 440385de14
3 changed files with 3 additions and 0 deletions

View File

@ -221,6 +221,7 @@ static void killAppendOnlyChild(void) {
server.aof_rewrite_time_start = -1;
/* Close pipes used for IPC between the two processes. */
aofClosePipes();
closeChildInfoPipe();
}
/* Called when the user switches from "appendonly yes" to "appendonly no"

View File

@ -451,6 +451,7 @@ void flushallCommand(client *c) {
if (server.rdb_child_pid != -1) {
kill(server.rdb_child_pid,SIGUSR1);
rdbRemoveTempFile(server.rdb_child_pid);
closeChildInfoPipe();
}
if (server.saveparamslen > 0) {
/* Normally rdbSave() will reset dirty, but we don't want this here

View File

@ -1255,6 +1255,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
(long) server.rdb_child_pid);
kill(server.rdb_child_pid,SIGUSR1);
rdbRemoveTempFile(server.rdb_child_pid);
closeChildInfoPipe();
}
if (rename(server.repl_transfer_tmpfile,server.rdb_filename) == -1) {