litedb-org / LiteDB

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

Fix LockRecursionException when doing FindById #2488

Closed JKamsker closed 5 months ago

JKamsker commented 6 months 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 6 months 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.