[mythtv] mythbackend 0.22-fixes problem with duplicate database connection name

Jim Stichnoth stichnot at gmail.com
Tue Mar 2 18:34:54 UTC 2010

On Tue, Mar 2, 2010 at 10:17 AM, Roger James
<roger at beardandsandals.co.uk> wrote:
> I have been recently seeing a problem with mythbackend (0.22-fixes rev
> 23482) reporting that the database connection had gone away and some (all?)
> database transactions being rejected with a "Driver not loaded" error. The
> common factor behind these failures seems be that they all start after the
> following QSqlDatabasePrivate messages are logged.
> QSqlDatabasePrivate::removeDatabase: connection 'DBManager5' is still in
> use, all queries will cease to work.
> QSqlDatabasePrivate::addDatabase: duplicate connection name 'DBManager5',
> old connection removed.
> 2010-02-28 05:32:54.876 New DB connection, total: 6
> 2010-02-28 05:32:54.877 Connected to database 'mythconverg' at host: myth
> 2010-02-28 05:32:54.878 MSqlDatabase::OpenDatabase(), db object is not
> valid!
> QSqlQuery::exec: database not open
> QSqlQuery::exec: database not open
> 2010-02-28 05:32:54.933 Driver error was [1/-1]:
> Driver not loaded
> Database error was:
> Driver not loaded
> This leaves the backend in a confused state where it appears that some
> database transactions are failing are and I suspect some are still working.
> Subsquent new recordings appear in the new recordings list but but have no
> file associated with them. My guess is that database connections
> "DBManager0" to "DBManager4" are still working but the old "DBManager5" is
> now broken.
> I do not recollect having this problem on my old single processor backend
> system. I think I have only seen it on my new quad core fast processor
> system. But I cannot be certain.
> The problem usually seems to occur when the system is just idling doing EIT
> scans. But I have it occur twice when three recordings tried to start at the
> same time.
> The only similar problem I can find is
> http://svn.mythtv.org/trac/ticket/7836. But this is reported as a frontend
> problem. I wonder if the same bug in MDBManager could be causing my problem.

I suspect this is due to the existing bug I mentioned in the first
comment of #7836, where a field in MDBManager is being used both to
keep track of the number of open DB connections and to create unique
connection names, allowing the possibility of duplicate connection
names and the log messages you posted.  This can happen in any myth
app, not just the frontend.


More information about the mythtv-dev mailing list