Bug #1306

mysql_query() call might block if updates are done to the table (or a WRITE table lock is done)

Added by Anonymous 463 days ago. Updated 42 days ago.

Status:Wontfix Start:
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:mod_mysql_vhost
Target version:1.5.0
Pending:

No

Resolution:

wontfix

Patch available:


Description

If the table used by the mod_mysql_vhost plugin gets updated (or locked using "LOCK TABLE <table_name> WRITE"), then the mysql_query() will block until the lock gets released.

This can potentially HALT the main lighttpd process, and make ALL connections freeze.

I've seen this behavior on our hosting server where we get 1M+ req/day.

One way to fix this (though not trivial) would be to fork a process that we would send SQL queries to from any plugin requiring the SQL backend; we could then register an event waiting for the results on a socket opened to the SQL backend.

-- marc

History

08/17/2007 05:33 PM - jan

  • Status changed from New to Fixed
  • Resolution set to wontfix

This is a known limitation. Even if you put it in a thread or a external process the behaviour will be the same as ALL connections need the docroot and ALL will go the external process which blocks on the LOCK.

In short: just don't do it.

08/20/2007 03:07 PM - Anonymous

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (wontfix)

You are right for new connections, but what about all requests currently being served (transmitting the response for example). That would at least keep them responsive.

If the lock is "permanent" or last for many seconds, that would still be a major problem, but for locks around a second, that would keep things rolling in the mean time.

If I find/create a decent implementation, I'll let you know.

--marc

-- marc

08/23/2007 05:36 PM - jan

  • Status changed from Need Feedback to Fixed
  • Resolution set to wontfix

10/10/2008 07:05 PM - stbuehler

  • Status changed from Fixed to Wontfix

Also available in: Atom PDF