You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDistributedLockProvider for Redis won't acquire lock when using multiple databases #240
var connectionPoolManager = services.BuildServiceProvider().GetService<IRedisConnectionPoolManager>()
?? new RedisConnectionPoolManager(connectionConfiguration);
var dbs = connectionPoolManager.GetConnections().Select(c => c.GetDatabase());
This wont work (handle returns null always - no exception thrown): services.AddSingleton<IDistributedLockProvider>(_ => new RedisDistributedSynchronizationProvider(dbs);
But this does work:
services.AddSingleton<IDistributedLockProvider>(_ => new RedisDistributedSynchronizationProvider(dbs.First()));
@omexus in this scenario are the different IDatabase objects pointing to separate keyspaces/distinct servers? If they are different views to the same DB, it won't work.
Activity
madelson commentedon May 14, 2025
@omexus in this scenario are the different
IDatabaseobjects pointing to separate keyspaces/distinct servers? If they are different views to the same DB, it won't work.