Fix crash on shutdown command
Former-commit-id: d72b5fa16df0c41dd62b8b6d25c1c2c9cce8b413
This commit is contained in:
parent
7ad562c41a
commit
78b87d4ed1
@ -3295,6 +3295,8 @@ void flushSlavesOutputBuffers(void) {
|
||||
listIter li;
|
||||
listNode *ln;
|
||||
|
||||
flushReplBacklogToClients();
|
||||
|
||||
listRewind(g_pserver->slaves,&li);
|
||||
while((ln = listNext(&li))) {
|
||||
client *replica = (client*)listNodeValue(ln);
|
||||
|
@ -4203,6 +4203,8 @@ int prepareForShutdown(int flags) {
|
||||
/* Best effort flush of replica output buffers, so that we hopefully
|
||||
* send them pending writes. */
|
||||
flushSlavesOutputBuffers();
|
||||
g_pserver->repl_batch_idxStart = -1;
|
||||
g_pserver->repl_batch_offStart = -1;
|
||||
|
||||
/* Close the listening sockets. Apparently this allows faster restarts. */
|
||||
closeListeningSockets(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user