mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Fix child info pipe fd leak when child process gets killed.
This commit is contained in:
parent
81008bf99e
commit
440385de14
@ -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"
|
||||
|
1
src/db.c
1
src/db.c
@ -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
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user