[mythtv] possible timing/locking bug between mythfilldatabase and the scheduler?

Ronald Frazier ron at ronfrazier.net
Wed May 21 02:37:19 UTC 2008


Last night I noticed one of my scheduled programs wasn't recorded.
When I went to look at the backend log files, I saw that the program
had started recording as scheduled, but less than a minute later
something told it to stop recording. I can tell you that nobody
manually canceled this recording...the only frontend that was on
hadn't been used in hours...in fact, it was about 10 minutes from
timing out of LiveTV.

After looking some more, I noticed that mythfilldatabase had been
running at the exact same time the recording started. Also, I've got a
script that I have in cron running once an hour, and it runs
"mythbackend --printsched", examines the output, and emails me if it
sees certain things. Well, the email it sent to me said that it had
received an empty schedule from "mythbackend --printsched". It seems
to me as if mythfilldatabase is locking the program table, and when
the other parts of myth try to access it they treat it as an empty
schedule rather than an error, and this is causing the scheduler to
cancel the recording in progress.

This isn't the first time I've had a recording like this mysteriously
cancelled at the last minute, though this is the first time I've had
an adequate level of logging to see what has happened. I also think
I've noticed this manifesting itself in other ways. For instance,
trying to change channels in live tv will occasionally just hang at a
black screen, and sometimes that will go on for several minutes before
it returns to normal. I've had no luck tracking that problem down, but
now I'm thinking it may be related to running mythfilldatabase...it
can't get the program info from the DB if the table is locked, so it
just hangs. I gave it a shot, running mythfilldatabase and then trying
to switch channels and I was eventually able to replicate the same
black screen. I tried replicating the canceled recording with no luck
there, but perhaps thats a very timing critical issue and I wasn't
able to hit the right timing.

I've posted the log messages from the backend here:
http://www.ronfrazier.net/mythtv/backend.log

I'd love for someone else to take a look at it and give me an opinion
on why you think the show was cancelled? I don't pretend to know what
all of those log messages mean. Does my theory make sense given what
you see there?


-- 
Ron


More information about the mythtv-dev mailing list