-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix: Fixed issue where tags loaded slowly #10577
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
Conversation
Even with LiteDB v4, it still does not work and causes crashing on multiple files instance startup. (Multiple processes cannot open the same LiteDB file simultaneously because the LiteDB will lock the opened file). BTW the recommended way for concurrency is described here: https://github.com/mbdavid/LiteDB/wiki/Concurrency.
So downgrading to v4 doesn't resolve any problem. How about replacing LiteDB with SQLite? |
I can't reproduce the issue with v4, how do I trigger the crash? Simply opening a few instances of Files and browsing around appears ok. And it has always been like this since UWP days. SQLite is even worse for concurrency iirc (throws the "database is locked" error all the times). |
Try opening two files instances and then do file operation (such as Copy, Move, Delete...) on one. |
The problem was here before we bump the LiteDB: #10008 (review) |
Have you verified with this PR? Code is a bit different from #10008.
Appears ok for me |
I remembered that after merging #10008 we were not able to do the above things until #10250 got merged. Maybe something has changed later. |
I'll take this as "I've tested your PR and it does not crash so it's worth more testing" :)
Good idea 👍 |
Here is a console program that runs a bunch of read/write to the DB. Launching the exe a few times concurrently appears OK. Let me know if you want to run more tests. |
Well seems that the concurrency issue no longer persists. It's good to me. |
Wow I've just tried the test app with LiteDB v5 and read/write perfo is awful when using Shared mode (1 second per each write). That is probably the cause of slow loading of tags. Yuk LiteDB v5! (not their fault, I think they switched from file locks to global mutexes for concurrency). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Resolved / Related Issues
Items resolved / related issues by this PR.
Validation
How did you test these changes?