Discussion:
Long-running app loses mysql connection
David Faure
2013-06-11 17:00:27 UTC
Permalink
Here's the reason zanshin can't save my events, when I let it run for a very long time (many days) and only use it occasionnally (unlike kmail) :

new ItemCreateJob
Database error: DataStore::beginTransaction
Last driver error: "QMYSQL: Unable to begin transaction"
Last database error: "MySQL server has gone away"
Error during executing query "INSERT INTO PimItemTable (rev, remoteRevision, collectionId, mimeTypeId, datetime, atime, dirty, size) VALUES (:0, :1, :2, :3, :4, :5, :6, :7
)" : "Lost connection to MySQL server during query QMYSQL3: Unable to reset statement"
Error during insertion into table "PimItemTable" "Lost connection to MySQL server during query QMYSQL3: Unable to reset statement"
DataStore::rollbackTransaction(): No transaction in progress!
"Append failed"

-> this looks like a timeout in the mysql connection.

KMail still works fine at that point.

Does anyone know about mysql connections dropping out, and how to avoid it, or how
to handle this transparently in akonadi libs so that apps don't have to handle it themselves?
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5


_______________________________________________
KDE PIM mailing list kde-***@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
Daniel Vrátil
2013-06-11 17:01:09 UTC
Permalink
Post by David Faure
Here's the reason zanshin can't save my events, when I let it run for a very
new ItemCreateJob
Database error: DataStore::beginTransaction
Last driver error: "QMYSQL: Unable to begin transaction"
Last database error: "MySQL server has gone away"
Error during executing query "INSERT INTO PimItemTable (rev, remoteRevision,
collectionId, mimeTypeId, datetime, atime, dirty, size) VALUES (:0, :1, :2,
:3, :4, :5, :6, :7 )" : "Lost connection to MySQL server during query
QMYSQL3: Unable to reset statement" Error during insertion into table
Unable to reset statement" DataStore::rollbackTransaction(): No transaction
in progress!
"Append failed"
-> this looks like a timeout in the mysql connection.
KMail still works fine at that point.
Does anyone know about mysql connections dropping out, and how to avoid it,
or how to handle this transparently in akonadi libs so that apps don't have
to handle it themselves?
According to [0], using setConnectOption("MYSQL_OPT_RECONNECT=1") should
automatically restore the connection if it's lost. It could be simply added to
the Akonadi server as a default option for MySQL backend.

Note sure how about PostgreSQL (if the problem is valid there too).

Cheers,
Dan

[0] https://bugreports.qt-project.org/browse/QTBUG-17140
--
Daniel Vrátil
Associate Software Engineer, KDE Desktop Team
Red Hat, Inc

GPG Key: 0xC59D614F6F4AE348
Fingerprint: 4EC1 86E3 C54E 0B39 5FDD B5FB C59D 614F 6F4A E348
Andras Mantia
2013-06-11 17:30:57 UTC
Permalink
Post by Daniel Vrátil
According to [0], using setConnectOption("MYSQL_OPT_RECONNECT=1") should
automatically restore the connection if it's lost. It could be simply
added to the Akonadi server as a default option for MySQL backend.
Note sure how about PostgreSQL (if the problem is valid there too).
Yes, the same problem is present with PostgreSQL, you need an extra query to
actually detect the loss of connection.

Andras
_______________________________________________
KDE PIM mailing list kde-***@kde.org
https://mail.kde.org/mailman/listinfo/kde-p

Loading...