summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2017-03-21 07:20:02 -0700
committerantirez <antirez@gmail.com>2017-12-11 11:09:33 +0100
commitd9363b6b3b9fb774f94582247b8833cdc05dca5b (patch)
tree0adccdc1de0cccd5476f3911e5dcd6432ca3fadd
parent522760fac79536eb68dc5fc70e9166f689eb76dc (diff)
downloadredis-d9363b6b3b9fb774f94582247b8833cdc05dca5b.tar.gz
Redis kept streaming RDB to a disconnected slave
-rw-r--r--src/networking.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c
index e1b9ba048..ecf40ce62 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -780,6 +780,13 @@ void unlinkClient(client *c) {
c->client_list_node = NULL;
}
+ /* In the case of diskless replication the fork is writing to the
+ * sockets and just closing the fd isn't enough, if we don't also
+ * shutdown the socket the fork will continue to write to the slave
+ * and the salve will only find out that it was disconnected when
+ * it will finish reading the rdb. */
+ shutdown(c->fd, SHUT_RDWR);
+
/* Unregister async I/O handlers and close the socket. */
aeDeleteFileEvent(server.el,c->fd,AE_READABLE);
aeDeleteFileEvent(server.el,c->fd,AE_WRITABLE);