Merge pull request #5798 from trevor211/fixChildInfoPipeFdLeak

Fix child info pipe fd leak when child process gets killed.
This commit is contained in:
Salvatore Sanfilippo 2019-01-21 11:21:12 +01:00 committed by GitHub
commit 5f42bfce05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; server.aof_rewrite_time_start = -1;
/* Close pipes used for IPC between the two processes. */ /* Close pipes used for IPC between the two processes. */
aofClosePipes(); aofClosePipes();
closeChildInfoPipe();
updateDictResizePolicy(); updateDictResizePolicy();
} }

View File

@ -451,6 +451,7 @@ void flushallCommand(client *c) {
if (server.rdb_child_pid != -1) { if (server.rdb_child_pid != -1) {
kill(server.rdb_child_pid,SIGUSR1); kill(server.rdb_child_pid,SIGUSR1);
rdbRemoveTempFile(server.rdb_child_pid); rdbRemoveTempFile(server.rdb_child_pid);
closeChildInfoPipe();
updateDictResizePolicy(); updateDictResizePolicy();
} }
if (server.saveparamslen > 0) { if (server.saveparamslen > 0) {

View File

@ -1256,6 +1256,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
(long) server.rdb_child_pid); (long) server.rdb_child_pid);
kill(server.rdb_child_pid,SIGUSR1); kill(server.rdb_child_pid,SIGUSR1);
rdbRemoveTempFile(server.rdb_child_pid); rdbRemoveTempFile(server.rdb_child_pid);
closeChildInfoPipe();
updateDictResizePolicy(); updateDictResizePolicy();
} }