[BUG] No thread safety since 5.0.21
Version 5.0.21
Describe the bug We assume that a LiteDatabase instance is not thread-safe since the last update (V 5.0.21), maybe this PR was wrong: #2447 Our application writes code to the same LiteDatabase instance in different threads. And since 5.0.21 we have a strange bug that sometimes writes corrupt data.
Solved?
this is the same issue as this.
https://github.com/litedb-org/LiteDB/issues/2528
I have a litedb 4 in production that works very well since 2018. now I'm going to update application, and I'm thinking to update litedb to 5. reading this kind of issue don't put me on a good feeling :-) what do you think about?
I have written a test project showing the bug & effect. We will update our older issue and that should help to fix it.
As written by others the bug was introduced in one of the last releases. For us it was visible as we updated from .20 to .21.
So, the good news is that older versions should be safe. We downgraded to .20 after we noticed the effect and other report .17 as safe.
Here is an Examlpe Repo cleary showing the problem.
https://github.com/dos-ise/LiteDB_ThreadSafetyTest
Thanks 👍