Skip to content

Sleeping time not configurable when reconnecting to Sentinel #2864

@barbasa

Description

@barbasa

Expected behavior

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.

Actual behavior

The retry time is hardcoded to 5000ms.

Steps to reproduce:

  1. Setup a Redis cluster using Sentinels
  2. Connect the Santinels in your app
  3. Stop your sentinels
  4. Check the logs. In the logs there will be a message like: "Lost connection to Sentinel at sentinelhost:sentinelport. Sleeping 5000ms and retrying"

The 5000ms is not configgurable.

Redis / Jedis Configuration

Jedis version: 2.10.2

Redis version: 6.2

Java version: 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions