From 4edf50d8e2ff93ca3ebfd5dce8af06c61fecd366 Mon Sep 17 00:00:00 2001 From: qetu3790 Date: Fri, 16 Jul 2021 11:40:25 +0800 Subject: [PATCH] Set TCP keepalive on inbound clusterbus connections (#9230) Set TCP keepalive on inbound clusterbus connections to prevent memory leak (cherry picked from commit f03af47a34ec672a7d9b18150a5be3a83681c19b) --- src/cluster.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cluster.c b/src/cluster.c index 28650b327..246eb4050 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -707,6 +707,7 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) { } connNonBlock(conn); 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);