MySQL server has gone away

Bug #927473 reported by Raoul Snyman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Fix Released
Medium
Raoul Snyman

Bug Description

When using MySQL, if connections have been open longer than an hour, MySQL closes the connection but does not inform the application. This results in the following error message:

OperationalError: 2006, 'MySQL server has gone away'

The easiest way to fix this is most likely to use the NullPool class in SQLAlchemy when creating the connection. This will force SQLAlchemy to create a new connection every time, bypassing this issue.

Related branches

Changed in openlp:
assignee: nobody → Raoul Snyman (raoul-snyman)
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

It looks like we're already using NullPool. There goes that theory...

Revision history for this message
mahfiaz (mahfiaz) wrote :

Then should we just catch that exception, create a new connection and send the query again?

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Yes, something like that. In a way it's not that simple, and yet it's simpler than that.

Changed in openlp:
status: New → Fix Committed
Changed in openlp:
status: Fix Committed → Fix Released
Revision history for this message
Phill (phill-ridout) wrote :
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Yes, it should.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.