Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] No thread safety since 5.0.21 #2554

Open
feitzi opened this issue Oct 11, 2024 · 6 comments
Open

[BUG] No thread safety since 5.0.21 #2554

feitzi opened this issue Oct 11, 2024 · 6 comments
Labels

Comments

@feitzi
Copy link

feitzi commented Oct 11, 2024

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.

@feitzi feitzi added the bug label Oct 11, 2024
@novecento
Copy link

Solved?

@dos-ise
Copy link

dos-ise commented Jan 7, 2025

this is the same issue as this.

#2528

@novecento
Copy link

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?

@michtoen
Copy link

michtoen commented Jan 7, 2025

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.

@dos-ise
Copy link

dos-ise commented Jan 8, 2025

Here is an Examlpe Repo cleary showing the problem.

https://github.com/dos-ise/LiteDB_ThreadSafetyTest

@JKamsker
Copy link
Collaborator

JKamsker commented Jan 8, 2025

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants