mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Merge pull request #5798 from trevor211/fixChildInfoPipeFdLeak
Fix child info pipe fd leak when child process gets killed.
This commit is contained in:
commit
5f42bfce05
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
src/db.c
1
src/db.c
@ -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) {
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user