Quasselcore doesn't handle interrupted PostgreSQL connection
When quasselcore is using PostgreSQL and the database connection is interrupted for whatever reason while the core is running (service restart, network interruption when using a non-local PostgreSQL server), the core does no longer work properly until it is restarted:
- No new messages appear in connected clients
- Newly connected clients don't received backlog, even though the GUI pretends backlog fetch is happening (no error message)
- The core log fills with QsqlQuery errors like this:
2010-09-26 11:00:43 Error: unhandled Error in QSqlQuery!
2010-09-26 11:00:43 Error: last Query: EXECUTE quassel_1 (147, 500)
2010-09-26 11:00:43 Error: executed Query:
2010-09-26 11:00:43 Error: bound Values:
2010-09-26 11:00:43 Error: Error Number: -1
2010-09-26 11:00:43 Error: Error Message: FEHLER: vorbereitete Anweisung Ã�Â»quassel_1Ã�Â« existiert nichtQPSQL: Es konnte keine Abfrage erzeugt werden
2010-09-26 11:00:43 Error: Driver Message: QPSQL: Es konnte keine Abfrage erzeugt werden
2010-09-26 11:00:43 Error: DB Message: FEHLER: vorbereitete Anweisung Ã�Â»quassel_1Ã�Â« existiert nicht
I would expect quasselcore to perform a reconnect if it loses database connection, and proceed like normal.
#1 Updated by TerrorBite almost 11 years ago
Confirming this bug.
It appears that the core will reconnect to the database, however it does not set back up Quassel's prepared statements (apparently this is only done at core startup). As a result, any database operation that relies on a prepared statement will fail after the database connection is interrupted, since those statements no longer exist in the database engine.