As per StackExchange.Redis code, following exceptions seem like they need to be retried (connection error, sever error).
RedisServerException: Indicates an exception raised by a redis server
RedisConnectionException
Indicates a connection fault when communicating with redis
RedisException
Indicates an issue communicating with redis_
Is it safe to retry on these errors? Are they any other exceptions that need to be retried on?
Redis Best practices:
https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#when-is-it-safe-to-retry
puts onus on users of Redis for retries. But is silent which exceptions can be safely retried.
Thanks,
Where you retry depends on what you're trying to do, see my comments here on why it's so specific to the intent and not the exception:
https://github.com/StackExchange/StackExchange.Redis/issues/528#issuecomment-268989780
OK thanks for the link.
Follow up question:
If I decide to retry for errors in Redis operation:
In case of errors I perform following two operations:
It depends on the error, if it's a connection error and you want to synchronously wait then you may create a new one. But doing so for a large number of commands would be very expensive.
Most helpful comment
OK thanks for the link.
Follow up question:
If I decide to retry for errors in Redis operation:
In case of errors I perform following two operations: