[mythtv-commits] Ticket #12130: Remove old entries from in-memory EIT cache

MythTV noreply at mythtv.org
Mon Apr 28 19:54:12 UTC 2014


#12130: Remove old entries from in-memory EIT cache
--------------------------------------+---------------------------------
     Reporter:  klaas.de.waal@…       |      Owner:  dekarl
         Type:  Bug Report - General  |     Status:  new
     Priority:  minor                 |  Milestone:  unknown
    Component:  MythTV - EIT          |    Version:  0.27-fixes
     Severity:  medium                |   Keywords:  eit epg cache ziggo
Ticket locked:  0                     |
--------------------------------------+---------------------------------
 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.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12130>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list