-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add configurable retry delay for Sentinel reconnection (#2864) #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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()
Test Results 285 files +2 285 suites +2 11m 36s ⏱️ -15s Results for commit e10808b. ± Comparison against base commit ea238d6. This pull request skips 1212 tests.♻️ This comment has been updated with latest results. |
There was a problem hiding this 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; |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
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.
| private Delay sentinellReconnectDelay = DEFAULT_RESUBSCRIBE_DELAY; | |
| private Delay sentinelReconnectDelay = DEFAULT_RESUBSCRIBE_DELAY; |
| */ | ||
| public SentinelClientBuilder<C> sentinelReconnectDelay(Delay reconnectDelay) { | ||
| JedisAsserts.notNull(reconnectDelay, "reconnectDelay must not be null"); | ||
| this.sentinellReconnectDelay = reconnectDelay; |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
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.
| 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); |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| /** | ||
| * Sets the delay between re-subscribing to sentinel node after a disconnection.* |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
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 ".*"
| * Sets the delay between re-subscribing to sentinel node after a disconnection.* | |
| * Sets the delay between re-subscribing to sentinel node after a disconnection. |
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