[ZODB-Dev] weird "MySQL gone away error" when viewing history tab on Script(Python) with RelStorage 1.4.2

Shane Hathaway shane at hathawaymix.org
Tue May 3 04:02:46 EDT 2011


On 05/03/2011 01:39 AM, Chris Withers wrote:
> On 27/04/2011 18:11, Shane Hathaway wrote:
>>> OperationalError: (2006, 'MySQL server has gone away')
>>>
>>> This is happening across at least two separate instances with separate
>>> storages.
>>>
>>> Any ideas?
>>
>> Maybe the query is killing MySQL, for whatever reason.
>
> I don't think so, since I'd then expect all the other storages served by
> that cluster to complain similarly.

Not necessarily.  RelStorage reconnects automatically.  The reconnection 
is invisible unless the disconnect happens in the middle of a request, 
in which case RelStorage raises the error then automatically reconnects 
on the next request.

> However, it's literally just the thread handling this particular request
> that shows the error...

Two ideas:

- MySQL is dropping the connection after a long period of inactivity, 
then RelStorage doesn't notice it's dropped until it's too late. 
Connections that poll take defensive steps to prevent that, but maybe 
you're using a connection that does not poll.

- A single MySQL thread is dying.  (Is MySQL multithreaded?)

Shane


More information about the ZODB-Dev mailing list