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();
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 thisto
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();