Opened 12 years ago
Closed 10 years ago
#10825 closed Bug Report - General (Fixed)
thread safety in video metadata load
Reported by: | Owned by: | beirdo | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | MythTV - Video Library | Version: | Unspecified |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
This is terribly obscure but I have been bit regularly and the backend dies without mentioning why so it's quite annoying.
The metadata loaders in libs/libmythmetadata/dbaccess.cpp keep static copies of their various lists for reuse after the first load but when two clients trigger "first" loads at the same time the stl inserts stomp on each other and it go boom.
A suggested patch is attached: I added mutexes to the various load_data methods and my BE is happier.
The patch reviewer can decide if it's worth adding protection to the other modifier methods.
Attachments (1)
Change History (4)
Changed 12 years ago by
Attachment: | 0001-protect-metadata-loads-from-multiple-threads.patch added |
---|
comment:1 Changed 12 years ago by
Owner: | set to beirdo |
---|---|
Status: | new → assigned |
comment:2 Changed 12 years ago by
comment:3 Changed 10 years ago by
Resolution: | → Fixed |
---|---|
Status: | assigned → closed |
Fixed in: commit cd80b1c740f335e91876c61ce1b7aaa022165d96 Author: George Nassas <george@…> Date: Sun Jun 10 13:36:42 2012 -0400
protect metadata loads from multiple threads
Signed-off-by: Jean-Yves Avenard <jyavenard@…>
Actually, I think a better plan is to mutex protect the m_entries list on all uses, and possibly likewise for the entry_map if necessary. The unprotected list is just asking for issues.
I'll take a look tonight.
Also, I'm curious why this uses std::list and std::map rather than QList and QMap.