PDO Deadlocks Galore on the Semaphore table I experience frequent deadlocks on the semaphore table that look like this:


  PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {semaphore} WHERE (name = :db_condition_placeholder_0) AND (value = :db_condition_placeholder_1) AND (expire &lt;= :db_condition_placeholder_2) ; Array ( [:db_condition_placeholder_0] => variable_init [:db_condition_placeholder_1] => 298999494f343fc583c3e2.30542255 [:db_condition_placeholder_2] => 1328824262.5293 ) in lock_may_be_available() (line 181 of /var/www/drupal/includes/lock.inc).


This site sees fairly heavy traffic. Is the load the cause of this? Is this due to a faulty module? Is this something in Drupal core?

Most importantly, are there precautionary measures I can take to avoid this?
It appears that once we implemented memcache the problem began to dissipate. It appears the database was writing very frequently to the cache tables, specifically the cache_form table. These deadlocks would appear when there were just too many commands running on the box.