Lua debugger: handle forked sessions children during shutdown.

This commit is contained in:
antirez
2015-11-13 09:31:01 +01:00
parent 3ab0b4d6d0
commit 7be9170585
3 changed files with 51 additions and 5 deletions

View File

@ -1201,10 +1201,11 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
} else if (pid == server.aof_child_pid) {
backgroundRewriteDoneHandler(exitcode,bysignal);
} else {
serverLog(LL_WARNING,
"Warning, detected child with unmatched pid: %ld"
" (EVAL forked debugging session?)",
(long)pid);
if (!ldbRemoveChild(pid)) {
serverLog(LL_WARNING,
"Warning, detected child with unmatched pid: %ld",
(long)pid);
}
}
updateDictResizePolicy();
}
@ -2528,6 +2529,9 @@ int prepareForShutdown(int flags) {
serverLog(LL_WARNING,"User requested shutdown...");
/* Kill all the Lua debugger forked sessions. */
ldbKillForkedSessions();
/* Kill the saving child if there is a background saving in progress.
We want to avoid race conditions, for instance our saving child may
overwrite the synchronous saving did by SHUTDOWN. */