[mythtv] Race condition in scheduler during pre-roll interval

Steve Davies steve at one47.co.uk
Mon Jan 19 09:32:00 EST 2004


Andrew M. Bishop said:
> There is a race condition that will allow a program to get recorded
> twice at the same time on a dual tuner system (with version 0.13).  It
> looks to me that the problem occurs when there is a change in the
> RecordChanged value in the database settings during the pre-roll
> period.
>
[snip]
>
> When I tried again deliberately to make this happen I had partial
> success.  During the pre-roll time for a recording, after the program
> had started recording, I selected a program from tomorrow.  This
> caused the backend to see a change in the list try to start recording
> another copy of the current program, but it failed with a database
> error.
>
> DB Error (WriteRecordedToDB):
> Query was:
> INSERT INTO recorded
> (chanid,starttime,endtime,title,subtitle,description,hostname,category,autoexpire)
> VALUES(...);
> Driver error was [2/1062]:
> QMYSQL3: Unable to execute query
> Database error was:
> Duplicate entry '4-20040118172900' for key 1
>
> This came after a message telling me that it was starting to record
> the same program with the other tuner card.

Hmmm... The fact that there is an entry in 'recorded' is meant to stop the
second instance being recorded. I can see how this is happening, and I'm
working on the scheduler at the moment (nearly have a working patch now)
I'll see if I can include a fix for this problem at the same time.

As far as I can tell, the "feature" you describe will only trigger if
there is no subtitle or description against the program, and if it is an
AllRecord and can indeed only happen for that short preroll gap (and only
global preroll I believe) and if a recordchanged event occurs.

[snip]

Regards,
Steve



More information about the mythtv-dev mailing list