There doesn’t seem to be a ‘closed’ event in Stackexchange.Redis, only a ‘connection failed’ event which indicates a temporary failure based on my understanding (and that is why there is also a ‘connection restored’ event?). Is this because StackExchange always retries when the connection is closed unexpectedly – is there an event to indicate when the connection is closed permanently?
Asked
Active
Viewed 378 times
1 Answers
1
No, there is not currently an event for "closed permenantly", as the only time this would be used would be after Dispose() has been invoked, which is usually an intentional and known-time thing.
If there is a well-defined scenario where this would be useful, I'm not against adding one, but currently: I don't see the purpose.

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900
-
I see, and with regards to ConnectionRestored is that because there is an internal retry logic? I have been going through the code and it seems that ConnectionRestored is fired on every successful connect. My understanding is that when an error occurs, ErrorMessage would be triggered followed by ConnectionRestored if we manage to connect successfully? – Abhishek Nanda May 28 '14 at 21:39
-
@Abhishek yes there is reconnect logic – Marc Gravell May 28 '14 at 21:43
-
regarding the reconnect logic, I am going through the code but I was wondering if you have some docs about in what cases you retry/when do you stop retrying...I want to figure out if we should remove our retry logic with our migration to StackExchange.Redis – Abhishek Nanda May 29 '14 at 23:21
-
@AbhishekNanda it doesn't give up ;p Actually, though, if anything it tries too hard - I might add in progressive slow-down on the retry. – Marc Gravell May 30 '14 at 07:14