提交 7cffd74b 编写于 作者: A antirez

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.
上级 eff8fb6f
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册