Project

General

Profile

Actions

Bug #1306

closed

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

Added by Anonymous over 16 years ago. Updated over 15 years ago.

Status:
Wontfix
Priority:
Normal
Category:
mod_mysql_vhost
Target version:
ASK QUESTIONS IN Forums:

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

Actions #1

Updated by jan over 16 years ago

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

Actions #2

Updated by Anonymous over 16 years ago

  • 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

Actions #3

Updated by jan over 16 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to wontfix
Actions #4

Updated by stbuehler over 15 years ago

  • Status changed from Fixed to Wontfix
Actions

Also available in: Atom