Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#12130 closed Bug Report - General (fixed)

Remove old entries from in-memory EIT cache

Reported by: klaas.de.waal@… 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)

eitcache.h.diff (523 bytes ) - added by klaas.de.waal@… 12 years ago.
"git diff" of eitcache.h
eitcache.h (1.4 KB ) - added by klaas.de.waal@… 12 years ago.
complete file including modifications
eitcache.cpp.diff (5.4 KB ) - added by klaas.de.waal@… 12 years ago.
"git diff" of eitcache.cpp
eitcache.cpp (11.3 KB ) - added by klaas.de.waal@… 12 years ago.
complete file including modifications

Download all attachments as: .zip

Change History (11)

by klaas.de.waal@…, 12 years ago

Attachment: eitcache.h.diff added

"git diff" of eitcache.h

by klaas.de.waal@…, 12 years ago

Attachment: eitcache.h added

complete file including modifications

by klaas.de.waal@…, 12 years ago

Attachment: eitcache.cpp.diff added

"git diff" of eitcache.cpp

by klaas.de.waal@…, 12 years ago

Attachment: eitcache.cpp added

complete file including modifications

comment:1 by Stuart Auchterlonie, 12 years ago

Cc: Stuart Auchterlonie added

comment:2 by Stuart Auchterlonie, 12 years ago

Milestone: unknown0.28
Owner: changed from Karl Egly to Stuart Auchterlonie
Status: newassigned

comment:3 by Klass De Waal <klaas.de.waal@…>, 12 years ago

In d0e25acac0cd671cb1eee4bb965bbcd35ffd88da/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:4 by Klass De Waal <klaas.de.waal@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In 583f44855ff80e032a6175939b1917a54337ccac/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:5 by Cédric Schieli <cschieli@…>, 12 years ago

In 3b621f5c4fd194aefe1c15bad78807ce85a13853/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:6 by klaas.de.waal@…, 12 years ago

The previous comment, number 5, is obviously not intended for this ticket.

comment:7 by Cédric Schieli <cschieli@…>, 12 years ago

In f4825ca432a14f7c85d79ad2bcf95cf77726635d/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available
Note: See TracTickets for help on using tickets.