JedisSentinelPool listen to the master messages via a MasterListener. If a connection with a Sentinel is lost, the listener tries to reconnect after a configurable sleeping time.
This can be an issue when several clients get disconnected together. When they will try to re-connect, all of them after 5000ms, to Redis they will create a spike in new connections.
Adding a random factor to the sleeping value, or making it configurable so that the user can define it randomly, would avoid the spike.
Expected behavior
JedisSentinelPool
listen to the master messages via aMasterListener
. If a connection with a Sentinel is lost, the listener tries to reconnect after a configurable sleeping time.This can be an issue when several clients get disconnected together. When they will try to re-connect, all of them after 5000ms, to Redis they will create a spike in new connections.
Adding a random factor to the sleeping value, or making it configurable so that the user can define it randomly, would avoid the spike.
Actual behavior
The retry time is hardcoded to 5000ms.
Steps to reproduce:
The
5000ms
is not configgurable.Redis / Jedis Configuration
Jedis version: 2.10.2
Redis version: 6.2
Java version: 11