[mythtv-users] 'Wakeup' Delay on Idle Frontend

Jim Stichnoth stichnot at gmail.com
Wed Dec 23 16:47:33 UTC 2009

On Wed, Dec 23, 2009 at 5:28 AM, Jim Stichnoth <stichnot at gmail.com> wrote:
> I wonder if this is due to changeset 17834
> (http://svn.mythtv.org/trac/changeset/17834) which added the
> MDBManager::PurgeIdleConnections() function.  This function is run
> when a new DB connection is initiated, and "cleans up" items in the DB
> connection pool that have been idle for at least 1 hour.  Presumably
> some interaction between Myth, QT, and MySQL is causing this.
> I can try a few things:
> * Disable the PurgeIdleConnections() function.

This seems to make the problem go away.  Specifically, I just put a
"return;" statement at the beginning of void
MDBManager::PurgeIdleConnections() and I did not see the problem
again.  Of course, that allows the problem addressed in changeset
17834 to come back.

> * Upgrade mysql.
> * Upgrade qt.

Upgrading mysql to 5.0.88 and qt to 4.5.3 had no effect on the problem.

> * Move the PurgeIdleConnections functionality into a separate thread.

This may be the second-best approach, if the root cause can't be found.

I made a couple other changes to help track this down.  First, I
changed the timeout value in PurgeIdleConnections() from 3600 to 15
seconds so I don't have to wait around for an hour.  Second, I added
log messages before and after the "delete entry;" statement to make
the delays more clear in the log.

I'm not sure how to reproduce the problem 100%, but this seems fairly reliable:

1. Start playback of some program, and let it play for long enough
that any existing DB connections go "idle" (3600 seconds for the
original code or 15 seconds for my modification).

2. Stop playback, and notice prebuffering pauses while one of these
idle connection purges causes the 5-second delay.

3. Exit out of the Watch Recordings screen into the main menu, wait
3600 (or 15) seconds, and then go back into Watch Recordings.  This
should cause the 5-second delay.

4. As far as I can tell, step 3 can be repeated and it will always
result in the 5-second delay.

I would appreciate hearing if this is also reproducible for others.


More information about the mythtv-users mailing list