Skip to content

Unsubscribing the channel works wrong #657

Description

@arteny

When subscribe we get connection from pool and subscribe.
When unsubscribe same channel or all channels we again get connection from pool and unsubscribe.
But multiplexers for subscribe and unsubscribe can be different.
So we really unsubscribe only if we are lucky (and same multiplexer will be chosen).

And possible solution for RedisDatabase class need to change
public IDatabase Database => connectionPoolManager.GetConnection().GetDatabase(dbNumber); // now it like this
to
public IDatabase Database = connectionPoolManager.GetConnection().GetDatabase(dbNumber);
or to keep current logic to use multiplexer for database from connections pool each time db is accessed, add fixed subscriber multiplexer (or its Subscriber) for RedisDatabase and use it for subscribe/unsubsribe operations:
public ISubscriber Subscriber = connectionPoolManager.GetConnection().GetSubscriber();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions