[JobQueue] Reduced the change of deadlocks in recycleStaleJobs().
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 6 Dec 2012 21:02:34 +0000 (13:02 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 6 Dec 2012 21:04:14 +0000 (13:04 -0800)
commit47e9cc7fe89fe4f33047e328b1036853cd28e3bd
tree970f9055e17046a1e6b10badb3136cb323cb2dc6
parentfd02cdf85eca341c0e4063db284e2bb0df6d538b
[JobQueue] Reduced the change of deadlocks in recycleStaleJobs().

* Do the DELETE by primary key to avoid gap locks. This should cut
  down on deadlocks, though their frequency is still fairly modest.
* Also use GET_LOCK() to assure that two processes are not doing this
  update at the same time.

Change-Id: Ic3de3b7cb3acd5294a151b4a00bfed65c33d0f1e
includes/job/JobQueueDB.php