Skip to content

Conversation

@walles
Copy link
Contributor

@walles walles commented Jan 22, 2021

Done as part of researching #2347.

This change adds tests for JedisClusterCommand.runWithRetries(), and fixes two logic errors in said method.

It contains no backoff, we thought it best to do this piecemeal and do that in another PR.

Johan Walles added 3 commits January 22, 2021 15:59
}

return runWithRetries(slot, attempts - 1, tryRandomNode, redirect);
return runWithRetries(slot, attempts - 1, true, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

This would heavily affect current applications. Connection exceptions can happen for silliest of the reasons. So we can't backoff right after a connection exception. There should a balance between retry and backoff. For example, a slot based node or a redirected node should be given at least 2/3 consecutive tries before backing off.

In all of the cases, maxAttempts, remaining attempts, renewSlotCache() should be kept in mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll just try to rephrase what you said so I know I understand:

  • With this change, we'd start trying random nodes on the first connection exception
  • In your opinion, what we should do is:
    1. First, try the exact same operation a few times in a row
    2. If that doesn't help, start trying random nodes

I think this sounds reasonable, just want to ensure I change the right thing!

Copy link
Contributor

Choose a reason for hiding this comment

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

@walles Yes, you've got it right.

@walles
Copy link
Contributor Author

walles commented Jan 27, 2021

Let's just revisit this after #2355 has gone in.

@walles walles closed this Jan 27, 2021
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.

2 participants