[development] Watchdog dieing on large queries

Khalid Baheyeldin kb at 2bits.com
Wed Apr 22 17:00:13 UTC 2009


On Wed, Apr 22, 2009 at 12:12 PM, Steven Surowiec <steven at digitalpulp.com>wrote:

> 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.


This is why we have syslog as an option in core since D6. Having to log to
the database does not scale for may sites, either because they are large and
hit the db too often, or because of large queries that overflow MySQL buffer
or something else.

I used it on most D6 sites.


> 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.
>

Seems like a reasonable change to the dblog module.
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/development/attachments/20090422/f376cb01/attachment-0001.htm>


More information about the development mailing list