Skip to content

Instantly share code, notes, and snippets.

Last active October 22, 2019 17:28
  • Star 14 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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?

Copy link

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.

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?

Copy link

JonCole commented Oct 19, 2019 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