[development] Watchdog dieing on large queries

Steven Surowiec steven at digitalpulp.com
Thu Apr 23 12:36:51 UTC 2009

The problem for me was that the query in question was larger than 
max_allowed_packet would allow, so I just had to increase this a bit. 
MySQL has some documentation on this setting at the below URL.


Miriam Natanzon wrote:
> I also have this problem.
> Any Solution??
> It caused me a timeout and then "MySQL server has gone away" response
> message...
> -----Original Message-----
> From: development-bounces at drupal.org
> [mailto:development-bounces at drupal.org]On Behalf Of Steven Surowiec
> Sent: Wednesday, April 22, 2009 7:12 PM
> To: development at drupal.org
> Subject: [development] Watchdog dieing on large queries
> I've found a workaround for myself for this one but just wanted to put
> it out there. When a query fails watchdog is used to insert it into the
> DB, which is fine 99.9% of the time, until that .1% bites you. The
> problem is that if the query (say inserting a new record into the
> "cache") causes a query that is larger than the MySQL query buffer
> limit. This results in a MySQL error that the query is too large to
> insert, which watchdog then picks up and tries to insert, which fails,
> which watchdog picks up ... and you get the point. Result? Infinite loop
> and then either a timeout or PHP runs out of memory and dies. I'd think
> the proper way to handle this would be to have a check that the specific
> error code for a MySQL error resulting from a query buffer violation
> doesn't try to insert the query, again just putting this out there.

More information about the development mailing list