Skip to content
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

Transient connection failures on Azure Redis instance #1149

Closed
MatanShabtay opened this issue May 20, 2019 · 3 comments
Closed

Transient connection failures on Azure Redis instance #1149

MatanShabtay opened this issue May 20, 2019 · 3 comments

Comments

@MatanShabtay
Copy link

Hi,

We've been using StackExchange.Redis version 1.2.6 NuGet to communicate with our Azure instance for the last year. As we suffered from a lot of transient connection failures, we recently decided to upgrade the StackExchange.Redis NuGet version to 2.0.601 as it promised to be provide more network stabillity.

However, we are now getting a new type of transient errors, some of the errors I've collected are:

  1. StackExchange.Redis.RedisConnectionException: UnableToConnect
  2. StackExchange.Redis.RedisConnectionException: Failed to write ---> StackExchange.Redis.RedisConnectionException: No connection is available to service this operation: SET
    3.StackExchange.Redis.RedisConnectionException: SocketFailure on redis.server.dns

Our connection string contains the following configuration:

  1. abortConnect=false
  2. ssl=true

Our Cloud Service communicates with 2 different Azure Redis instances (each one different purposes) and both of them have the same issues.
Both Redis servers are not heavily utilized.

Can someone advise how can we overcome this transient errors except adding retry logic ?
Does anyone else suffers from the same issues?

Thanks.

@mgravell
Copy link
Collaborator

mgravell commented May 20, 2019 via email

@mstavrev
Copy link

@MatanShabtay, we are also getting from time to time such intermittent disconnects. In most cases, these are caused by changes/maintenance on either Azure networking infrastructure or the VM(s)/Hypervisor machine servicing your particular Redis instance. Very often, when I detect such an error, if I user redis console and ask for "INFO SERVER", I see the uptime_in_seconds is a very small value, e.g. the Redis instance had been restarted, or moved to a new VM. When this happens any client connection would be dropped and the client reestablishes a new one to the new instance.

@NickCraver
Copy link
Collaborator

This won't be fixed for 1.2.6 (the issue is different and there will be no more 1.x releases). The 2.x flavor of similar issues is being tracked in #1120 with additional fixes in #1374. Closing this out just to collapse into those issues.

Without going through all those: in a cloud provider they failover and sever your connection. It happens. That's how they work. And there's nothing we can do about it...so the suggestion on retry logic for things that are safe to retry (e.g. incrementing an account balancer wouldn't be...because maybe it was a response that got dropped, and not a request) is the way to go. Only you can make that determination of what's safe in your app though.

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

No branches or pull requests

4 participants