Let users explicty configure ServerSelectionStrategy.ServerType in cases they are using a Redis Cluster. #1381
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.
We are using 1.2.6 version of StackExchange.Redis with Azure Redis cache and occasionally we get bunch of "No connection is available to service this operation" and sometime it goes into a state where it doesn't ever recover from this issue and we are forces to reboot those VMs to fix the problem.
I was looking at 1374 and using the same setup but using code of 1.2.6 SDK version with actual Azure Redis cache. I was able to repo the problem and noticed that whenever it happens, ConnectionMultiplexer -> ReconfigureAsyc function fails while PINGing Redis Server and as a result the clusterCount remain 0.
Now since we are not sure what type of Redis we are talking to, we default to ServerSelectionStrategy.ServerType i.e. ServerType.Standalone. I didn't went that deep into code, but somehow the endpoint is able to recover but we are still stuck with ServerSelectionStrategy.ServerType as Standalone due to which all subsequent calls fails with "No connection is available to service this operation". Given the part of ReconfigureAsyc I'm talking about is same in latest version as well, I'm pretty sure the problem will exists in there as well. Happy to try it out with latest version as well, just wanted to validate the change is acceptable first.
By giving option to explicitly specify, I'm thinking that way in case of failure, we don't have to assume about the type of Redis we are talking to and hence more deterministic behavior.