diff options
author | qetu3790 <qetu3790@163.com> | 2021-07-16 11:40:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 20:40:25 -0700 |
commit | f03af47a34ec672a7d9b18150a5be3a83681c19b (patch) | |
tree | b61e2772c37516e097489c9c4eb93b3e2505277b | |
parent | 334a9789f1108c0c78d5f57e0a4c13fa748a30b4 (diff) | |
download | redis-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.c | 1 |
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); |