Opened 5 years ago

Closed 5 years ago

Last modified 5 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@… 5 years ago.
"git diff" of eitcache.h
eitcache.h (1.4 KB) - added by klaas.de.waal@… 5 years ago.
complete file including modifications
eitcache.cpp.diff (5.4 KB) - added by klaas.de.waal@… 5 years ago.
"git diff" of eitcache.cpp
eitcache.cpp (11.3 KB) - added by klaas.de.waal@… 5 years ago.
complete file including modifications

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by klaas.de.waal@…

Attachment: eitcache.h.diff added

"git diff" of eitcache.h

Changed 5 years ago by klaas.de.waal@…

Attachment: eitcache.h added

complete file including modifications

Changed 5 years ago by klaas.de.waal@…

Attachment: eitcache.cpp.diff added

"git diff" of eitcache.cpp

Changed 5 years ago by klaas.de.waal@…

Attachment: eitcache.cpp added

complete file including modifications

comment:1 Changed 5 years ago by Stuart Auchterlonie

Cc: Stuart Auchterlonie added

comment:2 Changed 5 years ago by Stuart Auchterlonie

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

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

In d0e25acac0cd671cb1eee4bb965bbcd35ffd88da/mythtv:

Remove old entries from in-memory EIT cache

Refs #12130.

Signed-off-by: Stuart Auchterlonie <stuarta@…>

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

Resolution: fixed
Status: assignedclosed

In 583f44855ff80e032a6175939b1917a54337ccac/mythtv:

Remove old entries from in-memory EIT cache

Closes #12130.

Signed-off-by: Stuart Auchterlonie <stuarta@…>
(cherry picked from commit d0e25acac0cd671cb1eee4bb965bbcd35ffd88da)

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

In 3b621f5c4fd194aefe1c15bad78807ce85a13853/mythtv:

VAAPI: Don't try to crop frames, they have no real buffer attached.

Refs #12130
Signed-off-by: Stuart Auchterlonie <stuarta@…>

comment:6 Changed 5 years ago by klaas.de.waal@…

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

comment:7 Changed 5 years ago by Cédric Schieli <cschieli@…>

In f4825ca432a14f7c85d79ad2bcf95cf77726635d/mythtv:

VAAPI: Don't try to crop frames, they have no real buffer attached.

Refs #12130
Signed-off-by: Stuart Auchterlonie <stuarta@…>

(cherry picked from commit 3b621f5c4fd194aefe1c15bad78807ce85a13853)

Note: See TracTickets for help on using tickets.