-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Subscriptions are not always restored properly when reconnecting #273
Comments
I'm observing the same issue using Amazon Redis (2.8) Elasticache. My client subscriptions never restore if I restart the Redis server. On disconnect I tried destroying the multiplexer and recreating & re-subscribing, but oddly that didn't help. Also tried your physical.dispose() suggestion - no help. Only thing that restores subscriptions is to restart my client application. |
I'm experiencing the same issue; has anybody made any progress on working out why subscriptions are not restored on a reconnect? |
I have the same problem and I can simulate it easily. Redis server disconnects slow clients (e.g. clients that overcome 8MB buffer limit). If send a lot of data in one application and pause receiving in other (I press pause in Visual Studio) I get disconnected and then reconnected but subscriptions are no longer valid. Code 1: sender (flooder)
Code 2: receiver
|
Ok, strange thing - version 1.0.488 from the 5.november 2015 works fine (with my example). So this is probably different problem - still valid for last version though. |
These issues were fixed in later versions of the lib, but I missed the duplicate issue - my fault. Just closing out to cleanup here, but the re-subscription logic is much more resilient now and we're no longer seeing reports of it in 1.2.6. |
The internal class
ConnectionMultiplexer.Subscription
has logic that is supposed to ensurethat subscriptions are restored when reconnecting, however there seems to be a race condition
regarding in which order unsubscribe/subscribe commands are sent.
Sometimes the client resubscribes as expected but then, several seconds later, it may unsubscribe itself and thus forever be unsubscribed.
I find it a bit suspicious that the
Validate
-method sends unsubscribe and subscribecommands using
CommandFlags.FireAndForget
. The order of these commands is very important butis the order really preserved when using fire and forget?
Also, this may be unrelated, but it seems to me that there is a Dispose-call missing in
PhysicalBridge.OnDisconnected
around line 346. This strange unsubscribe-behaviour seems to completely disappear when I dispose the physical connection on disconnect.The text was updated successfully, but these errors were encountered: