[mythtv] [mythtv-commits] Ticket #1319: scheduler is sometimes recording wrong program
henri
henri at qais.com
Wed Mar 8 04:06:01 UTC 2006
On 7 Mar 2006, Chris Pinkham <cpinkham at bc2va.org> wrote:
> * On Tue Mar 07, 2006 at 10:07:20PM -0500, Michael T. Dean wrote:
> > looks good. I will say, though, that the last change to the code
> > section that requests the reschedule was [8025] (
> > http://svn.mythtv.org/trac/changeset/8025 --from Nov 23), which reverted
> > the change to that section in [7973] (
> > http://svn.mythtv.org/trac/changeset/7973 --from Nov 21).
>
> My [7973] was actually a bug which Bruce fixed in [8025].
> Mythfilldatabase doesn't connect to the backend by default, so the
> new test was always failing so the scheduler was never signalled.
>
i'm not sure how the scheduler is ever signalled with the current
setup...
if i read it correctly, using datadirect:
if mythfilldatabase is called with no parameters then it grabs 14 days
worth of data
if there are no changes on the next days schedule then :
1130 query.exec("SELECT count(*) from dd_v_program;");
1131 if (query.isActive() && query.size() > 0)
1132 {
1133 query.next();
1134 if (query.value(0).toInt() < 1)
1135 {
1136 VERBOSE(VB_GENERAL, "Did not find any new program data.");
1137 return false;
1138 }
1139 }
http://svn.mythtv.org/trac/browser/trunk/mythtv/programs/mythfilldatabase/filldata.cpp?rev=9292#L1130
is invoked and the "Did not find any new program data." is printed,
and grabDDData returns false
this is caught in :
3122 if (!grabData(*it, i, &qCurrentDate))
3123 {
3124 ++failures;
http://svn.mythtv.org/trac/browser/trunk/mythtv/programs/mythfilldatabase/filldata.cpp?rev=9292#L3122
so failures is no longer == 0
EVEN if there is a change in the schedule of one of the other 13 days
so fillData() returns false
which leads to main returning at line 3861 with "FILLDB_EXIT_DB_ERROR"
3856 if (!fillData(sourcelist))
3857 {
3858 VERBOSE(VB_IMPORTANT, "Failed to fetch some program info");
3859 gContext->LogEntry("mythfilldatabase", LP_WARNING,
3860 "Failed to fetch some program info", "");
3861 return FILLDB_EXIT_DB_ERROR;
3862 }
http://svn.mythtv.org/trac/browser/trunk/mythtv/programs/mythfilldatabase/filldata.cpp?rev=9292#L3856
so main() never calls ScheduleRecording::signalChange(-1)
it seems to me that the issue is that grabDDData should not return
false at line 1137, but instead should return true (if there are no
changes in the data for that day)
this would leave the database connection/some wacky error failure
mechanism working correctly, but allow for a day that has no data
changes.
am i missing something?
i tested this by removing an entry from tomorrow's listing (delete
from program where title = 'xxx' and starttime = 'yyy'; ) and running:
./mythfilldatabase --max-days 2
with "return false" at line 1137 it added the entry i removed, but
didn't re-run the scheduler
with "return true" at line 1137 it added the entry and completed
main() (running the scheduler)
henri
More information about the mythtv-dev
mailing list