Skip to content

Subscriptions are not always restored properly when reconnecting #273

@DavidZidar

Description

@DavidZidar

The internal class ConnectionMultiplexer.Subscription has logic that is supposed to ensure
that 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 subscribe
commands using CommandFlags.FireAndForget. The order of these commands is very important but
is 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions