Open
Description
Description
I cannot always reproduce this, but this happens in my concurrent test code and my business code is using MemoryLockFactory from EasyCaching.Core.
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.SemaphoreSlim'.
at System.Threading.SemaphoreSlim.WaitAsync(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at EasyCaching.Core.DistributedLock.MemoryLock.LockAsync(Int32 millisecondsTimeout, CancellationToken cancellationToken)
Related code
try {
if (await distributedLock.LockAsync(3000)) {
...
}
else {
throw new Exception("xxx");
}
}
finally {
await distributedLock.ReleaseAsync();
}
Specifications
- Provider : InMemory (version 1.9.2)
- Interceptor : AspectCore (version 8.0.0)
- Serializer : not use
- System : Ubuntu20.04