summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-10-22 15:53:45 +0200
committerantirez <antirez@gmail.com>2014-10-22 15:53:45 +0200
commitd4f6a1711defdc0b63629c797b550abbcca2b96f (patch)
treef2220de6eaac4833082202888754db1e17a99298
parent2309f15d89e94babb2e9ef29225a40d822828379 (diff)
downloadredis-d4f6a1711defdc0b63629c797b550abbcca2b96f.tar.gz
Diskless replication: set / reset socket send timeout.
We need to avoid that a child -> slaves transfer can continue forever. We use the same timeout used as global replication timeout, which is documented to also affect I/O operations during bulk transfers.
-rw-r--r--src/rdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rdb.c b/src/rdb.c
index b8e02b021..039ea03e9 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -1349,6 +1349,7 @@ void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) {
slave->id);
/* Restore the socket as non-blocking. */
anetNonBlock(NULL,slave->fd);
+ anetSendTimeout(NULL,slave->fd,0);
}
}
}
@@ -1414,6 +1415,7 @@ int rdbSaveToSlavesSockets(void) {
* We'll restore it when the children returns (since duped socket
* will share the O_NONBLOCK attribute with the parent). */
anetBlock(NULL,slave->fd);
+ anetSendTimeout(NULL,slave->fd,server.repl_timeout*1000);
}
}