mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.35k stars 1.22k forks source link

Fix LockRecursionException when doing FindById #2488

Closed JKamsker closed 3 weeks ago

JKamsker commented 3 weeks ago

Fixes #2471, https://github.com/mbdavid/LiteDB/issues/2435, https://github.com/mbdavid/LiteDB/issues/2483

Problem was, that the enumerator did not release the readlock when doing FindById. When the Checkpoint then tried to aquire a writelock, the semaphore threw an exception, because there was still a readlock pending.

JKamsker commented 3 weeks ago

Ok just found out it was already fixed by https://github.com/mbdavid/LiteDB/pull/2436 but this fix here has a easier git comparison and tests.