-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[PVR] Make PVR database threadsafe. #12844
Conversation
I've thought about this too, but I was somehow under the impression that the database itself can handle being called from multiple threads just fine? Do we hae locking like this in VideoDatabase too? |
AFAIK, no. |
@MilhouseVH could you include this PR in your next build? I would like to get some feedback. |
I think the VideoDatabase code does not share database instances across threads, at least the parts I've seen. Sqlite should be compiled with multithread support so also this shouldn't be an issue either. As far as I can see PVRManager holds the DB connection that is shared, so this changes are very needed. |
Yep. I have no idea why we have not spotted this earlier. We're getting crash reports containing various pvr database constellations for ages. Personally, I never encountered those crashes and 'always' had better things to do, that's why I have not investigated earlier. |
e63904a
to
8115199
Compare
We have positive feedback from users: https://forum.kodi.tv/showthread.php?tid=298461&pid=2652723#pid2652723 ;-) |
8115199
to
82abc43
Compare
jenkins build this please |
jenkins errors are unrelated |
class
CPVRDatabase
had no concurrency protection features but is accessed simultaneously from multiple threads. :-/ This PR introduces basic concurrency support forCPVRDatabase
.Example:
This should fix several occasional crashes reported in the forum and elsewhere.
Example: https://forum.kodi.tv/showthread.php?tid=298461&pid=2651405#pid2651405 (second crashlog in that posting)
I runtime-tested this change on macOS, latest Kodi master.
@Jalle19 for review?