Opened 10 years ago
Closed 10 years ago
Last modified 10 years ago
#12130 closed Bug Report - General (fixed)
Remove old entries from in-memory EIT cache
Reported by: | Owned by: | Stuart Auchterlonie | |
---|---|---|---|
Priority: | minor | Milestone: | 0.28 |
Component: | MythTV - EIT | Version: | 0.27-fixes |
Severity: | medium | Keywords: | eit epg cache ziggo |
Cc: | Stuart Auchterlonie | Ticket locked: | no |
Description
The EIT cache as implemented in libs/libmythtv/eitcache.cpp stores the EIT events in two places; in the MySQL database table eit_cache and in memory. All new events are compared against the in-memory cache; if the event is new or updated then the event is stored in the cache and function IsNewEIT returns true; otherwise it is ignored because it must have been processed already. The in-memory cache is periodically written to the database table eit_cache, but only the events that are not older than 24 hours. Additionally, all the entries in the eit_cache that are older than 24 hours are regularly deleted.
What is wrong is that there are never entries deleted from the in-memory cache. This causes false hits on the in-memory cache as soon as event ID's are re-used by the broadcaster. This means that the EPG is not updated anymore and that is exactly what happens when my mythbackend is running for more than a week. As soon as the mythbackend is restarted the in-memory cache is loaded from the database table eit_cache; this effectively removes all old entries from the in-memory cache; there are no false hits anymore and the EPG is within a few minutes up-to-date again. Note that if you have a broadcaster that does not re-use the event ID's as quickly as mine, Ziggo in The Netherlands, this problem does not happen that quickly but then you would get up to 64k events in the cache per channel, as the event ID is a 16 bits value.
The solution is to delete the entries that are older than 24 hours not only from the database but also from the in-memory cache. This is implemented in function WriteChannelToDB: remove event from the eventMap when the event is too old to store in the database. Another change to the code is in function IsNewEIT: process a new event if the endtime of the new event is different from the endtime in the cache, even if the table ID and the version suggest that the event is the same. This does actually happen on my DVB-C signal from Ziggo.
The patches, for files eitcache.h and eitcache.cpp, are attached.
Attachments (4)
Change History (11)
Changed 10 years ago by
Attachment: | eitcache.h.diff added |
---|
comment:1 Changed 10 years ago by
Cc: | Stuart Auchterlonie added |
---|
comment:2 Changed 10 years ago by
Milestone: | unknown → 0.28 |
---|---|
Owner: | changed from Karl Egly to Stuart Auchterlonie |
Status: | new → assigned |
comment:4 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 Changed 10 years ago by
The previous comment, number 5, is obviously not intended for this ticket.
"git diff" of eitcache.h