summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqetu3790 <qetu3790@163.com>2021-07-16 11:40:25 +0800
committerGitHub <noreply@github.com>2021-07-15 20:40:25 -0700
commitf03af47a34ec672a7d9b18150a5be3a83681c19b (patch)
treeb61e2772c37516e097489c9c4eb93b3e2505277b
parent334a9789f1108c0c78d5f57e0a4c13fa748a30b4 (diff)
downloadredis-f03af47a34ec672a7d9b18150a5be3a83681c19b.tar.gz
Set TCP keepalive on inbound clusterbus connections (#9230)
Set TCP keepalive on inbound clusterbus connections to prevent memory leak
-rw-r--r--src/cluster.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 92601b001..85b3eecd8 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -736,6 +736,7 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
return;
}
connEnableTcpNoDelay(conn);
+ connKeepAlive(conn,server.cluster_node_timeout * 2);
/* Use non-blocking I/O for cluster messages. */
serverLog(LL_VERBOSE,"Accepting cluster node connection from %s:%d", cip, cport);