Skip to content

Conversation

@ggivo
Copy link
Collaborator

@ggivo ggivo commented Dec 17, 2025

Adds configurable delay strategy for Sentinel subscription retries with exponential backoff and jitter support. Prevents all clients from reconnecting simultaneously when connection is lost.

Default: 5000ms constant delay (backward compatible)
New: Configurable via RedisSentinelClient.Builder.sentinelReconnectDelay()

Closes #2864

Adds configurable delay strategy for Sentinel subscription retries with
exponential backoff and jitter support. Prevents all clients from reconnecting
simultaneously when connection is lost.

Default: 5000ms constant delay (backward compatible)
New: Configurable via RedisSentinelClient.Builder.sentinelReconnectDelay()
@github-actions
Copy link

github-actions bot commented Dec 17, 2025

Test Results

   285 files  +2    285 suites  +2   11m 36s ⏱️ -15s
10 462 tests +7  9 196 ✅  - 1 205  1 266 💤 +1 212  0 ❌ ±0 
 2 767 runs  +7  2 767 ✅ +    7      0 💤 ±    0  0 ❌ ±0 

Results for commit e10808b. ± Comparison against base commit ea238d6.

This pull request skips 1212 tests.
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetdel
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetdelBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetex
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetexBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHsetex
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHsetexBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetdel
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetdelBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetex
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetexBinary
…

♻️ This comment has been updated with latest results.

@ggivo ggivo requested review from a-TODO-rov and Copilot December 19, 2025 14:21
@ggivo ggivo requested a review from atakavci December 19, 2025 14:22
@ggivo ggivo modified the milestone: 7.3.0 Dec 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

private JedisClientConfig sentinelClientConfig = null;

// delay between re-subscribing to sentinel nodes after a disconnection
private Delay sentinellReconnectDelay = DEFAULT_RESUBSCRIBE_DELAY;
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name "sentinellReconnectDelay" contains a typo with double 'l'. It should be "sentinelReconnectDelay" (single 'l') to match the method name "sentinelReconnectDelay" and standard spelling.

Suggested change
private Delay sentinellReconnectDelay = DEFAULT_RESUBSCRIBE_DELAY;
private Delay sentinelReconnectDelay = DEFAULT_RESUBSCRIBE_DELAY;

Copilot uses AI. Check for mistakes.
*/
public SentinelClientBuilder<C> sentinelReconnectDelay(Delay reconnectDelay) {
JedisAsserts.notNull(reconnectDelay, "reconnectDelay must not be null");
this.sentinellReconnectDelay = reconnectDelay;
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name "sentinellReconnectDelay" contains a typo with double 'l'. It should be "sentinelReconnectDelay" (single 'l') to match the method name "sentinelReconnectDelay" and standard spelling.

Copilot uses AI. Check for mistakes.
protected ConnectionProvider createDefaultConnectionProvider() {
return new SentineledConnectionProvider(this.masterName, this.clientConfig, this.cache,
this.poolConfig, this.sentinels, this.sentinelClientConfig);
this.poolConfig, this.sentinels, this.sentinelClientConfig, sentinellReconnectDelay);
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name "sentinellReconnectDelay" contains a typo with double 'l'. It should be "sentinelReconnectDelay" (single 'l') to match the method name "sentinelReconnectDelay" and standard spelling.

Copilot uses AI. Check for mistakes.
}

/**
* Sets the delay between re-subscribing to sentinel node after a disconnection.*
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JavaDoc has an extra asterisk at the end of the sentence. The line should end with a period, not ".*"

Suggested change
* Sets the delay between re-subscribing to sentinel node after a disconnection.*
* Sets the delay between re-subscribing to sentinel node after a disconnection.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sleeping time not configurable when reconnecting to Sentinel

2 participants