I'm using DistributedLock.Postgres in a project that is using EF Core 7 and Npgsql 7. If I update the project to use EF Core 8 and Npgsql 8 RC2 I am no longer able to acquire a lock. Instead, I see an error and stack trace like the following:
System.InvalidOperationException: Unexpected value '' from acquire command
at Medallion.Threading.Postgres.PostgresAdvisoryLock.TryAcquireAsync(DatabaseConnection connection, String resourceName, TimeoutValue timeout, CancellationToken cancellationToken) in /_/DistributedLock.Postgres/PostgresAdvisoryLock.cs:line 112
at Medallion.Threading.Internal.Data.MultiplexedConnectionLock.TryAcquireAsync[TLockCookie](String name, TimeoutValue timeout, IDbSynchronizationStrategy`1 strategy, TimeoutValue keepaliveCadence, CancellationToken cancellationToken, Boolean opportunistic) in /_/DistributedLock.Core/Internal/Data/MultiplexedConnectionLock.cs:line 74
at Medallion.Threading.Internal.Data.MultiplexedConnectionLock.TryAcquireAsync[TLockCookie](String name, TimeoutValue timeout, IDbSynchronizationStrategy`1 strategy, TimeoutValue keepaliveCadence, CancellationToken cancellationToken, Boolean opportunistic) in /_/DistributedLock.Core/Internal/Data/MultiplexedConnectionLock.cs:line 94
at Medallion.Threading.Internal.Data.MultiplexedConnectionLockPool.TryAcquireAsync[TLockCookie](String connectionString, String name, TimeoutValue timeout, IDbSynchronizationStrategy`1 strategy, TimeoutValue keepaliveCadence, CancellationToken cancellationToken) in /_/DistributedLock.Core/Internal/Data/MultiplexedConnectionLockPool.cs:line 91
at Medallion.Threading.Internal.Data.MultiplexedConnectionLockPool.TryAcquireAsync[TLockCookie](String connectionString, String name, TimeoutValue timeout, IDbSynchronizationStrategy`1 strategy, TimeoutValue keepaliveCadence, CancellationToken cancellationToken) in /_/DistributedLock.Core/Internal/Data/MultiplexedConnectionLockPool.cs:line 97
at Medallion.Threading.Internal.DistributedLockHelpers.Wrap[THandle](ValueTask`1 handleTask, Func`2 factory) in /_/DistributedLock.Core/Internal/DistributedLockHelpers.cs:line 41
at Medallion.Threading.Internal.DistributedLockHelpers.ThrowTimeoutIfNull[T](ValueTask`1 task, String object) in /_/DistributedLock.Core/Internal/DistributedLockHelpers.cs:line 142
I am creating the lock by passing the connection string to the PostgresDistributedLock
constructor rather than an IDbConnection
instance but I've found that I get the same error regardless of which constructor I use.
Reverting to EF Core 7/Npgsql 7 immediately fixes the issue.
aburakab, miegir and austins
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4