Skip to content

Instantly share code, notes, and snippets.

@JonCole
Last active October 22, 2019 17:28
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save JonCole/317fe03805d5802e31cfa37e646e419d to your computer and use it in GitHub Desktop.
Save JonCole/317fe03805d5802e31cfa37e646e419d to your computer and use it in GitHub Desktop.
AzureRedis-PatchingProces
@b-anand
Copy link

b-anand commented Oct 8, 2018

Can you share a code sample of how this must be implemented? The text can be interpreted differently by different people.

For example,

  1. Do we need to retry for TimeoutException, RedisConnectionException or SocketException even if abortConnect is set to false?

  2. There is a statement above:
    StackExchange.Redis will retry connection attempts - it will not retry operations. It is up to the application to retry operations.
    What does this mean? Retry the operations for what exceptions? (the above mentioned ones?) What if abortConnect is set to false and StackExchange.Redis will automatically reconnect? Do we still need to retry the operation?

@JonCole
Copy link
Author

JonCole commented Oct 12, 2018

  1. Last I tested this (before StackExchange.Redis 2.0 was released), connection blips from the server being patched could result in all three of the exceptions you listed, so you need to expect any of these can happen. I don't know if/how that has changed since 2.0 was released.

  2. Any exception thrown might indicate that the operation you tried to perform could have failed, but, unfortunately, it is very difficult to say for sure. I have a short section on when to retry inside of my best practices doc that may help clarify.

I have also updated the above doc to recommend that you use the reboot feature as a way to test how your application is affected by connection blips during failover.

@radu-serbanescu
Copy link

Is there a metric and/or event that we can track in a dashboard to correlate spikes in RedisConnectionException with patching/failover timelines?

@JonCole
Copy link
Author

JonCole commented Oct 19, 2019

https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-how-to-monitor#available-metrics-and-reporting-intervals has an "errors" metric that can be used to see failover events. We are planning on surfacing some audit events for patching as well, but I can't say yet when that will be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment