From 89dc16f01d159551df27060f47d536f77f84bef4 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Fri, 2 Aug 2019 17:17:19 +0800 Subject: [PATCH] networking: flushSlavesOutputBuffers bugfix --- src/networking.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/networking.c b/src/networking.c index 7976caf29..a39fd73d8 100644 --- a/src/networking.c +++ b/src/networking.c @@ -2468,7 +2468,6 @@ void flushSlavesOutputBuffers(void) { listRewind(server.slaves,&li); while((ln = listNext(&li))) { client *slave = listNodeValue(ln); - int events; /* Note that the following will not flush output buffers of slaves * in STATE_ONLINE but having put_online_on_ack set to true: in this @@ -2476,9 +2475,8 @@ void flushSlavesOutputBuffers(void) { * of put_online_on_ack is to postpone the moment it is installed. * This is what we want since slaves in this state should not receive * writes before the first ACK. */ - events = aeGetFileEvents(server.el,slave->fd); - if (events & AE_WRITABLE && - slave->replstate == SLAVE_STATE_ONLINE && + if (slave->replstate == SLAVE_STATE_ONLINE && + !slave->repl_put_online_on_ack && clientHasPendingReplies(slave)) { writeToClient(slave->fd,slave,0);