-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Retry with backoff on cluster connection failures (II) #2490
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No behavior changes, just a refactoring. Changes: * Replaces recursion with a for loop * Extract redirection handling into its own method * Extract connection-failed handling into its own method Note that `tryWithRandomNode` is gone, it was never `true` so it and its code didn't survive the refactoring.
Inspired by redis#1334 where this went real easy :). Would have made redis#2355 shorter. Free public updates for JDK 7 ended in 2015: <https://en.wikipedia.org/wiki/Java_version_history> For JDK 8, free public support is available from non-Orace vendors until at least 2026 according to the same table. And JDK 8 is what Jedis is being tested on anyway: <https://github.com/redis/jedis/blob/ac0969315655180c09b8139c16bded09c068d498/.circleci/config.yml#L67-L74>
* consider connection exceptions and disregard random nodes * reset redirection
This reverts commit 67a062a. Lots of tests in JedisClusterCommandTests started failing, need to be fixed before trying again.
1. We try to contact master => JedisConnectionException 2. We try to contact replica => It refers us to master, hasn't failed over yet 3. We try to contact master => JedisConnectionException 4. We try to contact replica => Success, because it has now failed over
Consider connection exceptions and disregard random nodes
Co-authored-by: Jens Green Olander <[email protected]>
Source (all of these point to the same place): * walles/retries-split * 4f80d73 * redis#2355
Conflicts: src/main/java/redis/clients/jedis/JedisCluster.java
yangbodong22011
previously approved these changes
Mar 30, 2021
gkorland
reviewed
Mar 30, 2021
gkorland
previously approved these changes
Mar 30, 2021
Conflicts: src/main/java/redis/clients/jedis/BinaryJedisCluster.java src/main/java/redis/clients/jedis/JedisCluster.java
|
Everything pushed to the original PR #2358 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original PR #2358 (by @walles)