Closed dethknite closed 2 years ago
I believe the issue is here: https://github.com/mbdavid/LiteDB/blob/1e014473976c779e94dccad7664266c748b4e945/LiteDB/Engine/Services/LockService.cs#L57
If this is called and no read lock is held.. it shouldn't be trying to release it.
Fix:
public void ExitTransaction()
{
// if current thread are in reserved mode, do not exit transaction (will be exit from ExitExclusive)
if (_transaction.IsWriteLockHeld) return;
if(_transaction.IsReadLockHeld)
_transaction.ExitReadLock();
}
Submitted a pull request with fix. https://github.com/mbdavid/LiteDB/pull/2198
LiteDB v5.0.11 / Win 11 / .NET 4.8
Ran into this during a system shutdown.