You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I‘m running redis in cluster mode. One of my master nodes’ gone down, after renewSlot, the broken node's evictionTimer thread should be closed otherwise it will cost thread leak.
Actual behavior
I fork the code and add a log to proof this behavior. In the clients.jedis.Connection.connect()
publicvoidconnect() {
if (!isConnected()) {
try {
.......
} catch (IOExceptionex) {
// here is the code I addedLOGGER.error("Connect error. Host: " + host + " Port: " + port + ", Exception = " + ex.getMessage());
broken = true;
thrownewJedisConnectionException(ex);
}
}
}
When one of my clsuter nodes is down, after recover by cluster renewSlot, the evictionTimer thread is not cancelled, below error log continue printing:
GenericObjectPoolConfig config = new GenericObjectPoolConfig();
config.setMinIdle(1);
config.setMaxIdle(2);
config.setTestWhileIdle(true);
config.setTimeBetweenEvictionRunsMillis(5000L);
jedisCluster = new JedisCluster(new HostAndPort("127.0.0.1", 6379), config);
kill a cluster node
invoke get request to broken node to trigger renewSlot
view log
Redis / Jedis Configuration
Jedis version:2.9.0
Redis version: Redis 3.0.7
Java version:jdk 1.8.0_144
The text was updated successfully, but these errors were encountered:
leewcc
changed the title
Redis cluster node broken,After renewSlot,Node's broken evictionTimer thread does not cancel
When one of the Redis cluster nodes is crashed, its evictionTimer thread is not closed at the same time
Dec 9, 2019
The renewSlotCache method appends the new cluster node rediscovered when topology changed to the nodes map cache, while it does not remove the offline nodes or clear the nodes map cache. See setupNodeIfNotExist for detail. This case, testWhileIdle was true and TimeBetweenEvictionRunsMillis was set 5000ms, the evictor thread will be executed every 5000ms to evict idle jedis and create jedis connection to nodes if needed to ensure minIdle.
Expected behavior
I‘m running redis in cluster mode. One of my master nodes’ gone down, after renewSlot, the broken node's evictionTimer thread should be closed otherwise it will cost thread leak.
Actual behavior
I fork the code and add a log to proof this behavior. In the clients.jedis.Connection.connect()
When one of my clsuter nodes is down, after recover by cluster renewSlot, the evictionTimer thread is not cancelled, below error log continue printing:
Steps to reproduce:
Redis / Jedis Configuration
Jedis version:2.9.0
Redis version: Redis 3.0.7
Java version:jdk 1.8.0_144
The text was updated successfully, but these errors were encountered: