Under high load, for large sites with lots of user sessions, errors can appear on deleting from the login_security_track table.

PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {login_security_track} #012WHERE (timestamp < :db_condition_placeholder_0) ; Array#012(#012 [:db_condition_placeholder_0] => 1508860674#012)#012 in _login_security_remove_all_events() (line 350 of /…/sites/all/modules/contrib/login_security/login_security.module)

The _login_security_remove_all_events() function probably needs to lock_acquire() before executing the db_delete. Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joe-b created an issue. See original summary.

joe-b’s picture

Here's the patch.

joe-b’s picture

Status: Active » Needs review