Reviewed: https://reviews.mahara.org/881 Committed: http://gitorious.org/mahara/mahara/commit/93639aacf1423a9eabdaf06216912160a8f07494 Submitter: Andrew Robert Nicols ([email protected]) Branch: master
commit 93639aacf1423a9eabdaf06216912160a8f07494 Author: Richard Mansfield <[email protected]> Date: Thu Nov 24 16:41:59 2011 +1300 Fix race condition in cron (bug #891170) When cron finds a function with a stale (day-old) lock, just remove the lock and give up rather than trying to execute the function again. It's already pretty late, and waiting another minute for the next cron to start won't make a difference. This should avoid the case where two copies of cron both find the stale lock at the same time, and restart simultaneously. It won't matter if cron_lock fails to get a $started value because the row has been deleted: the next instance of cron to run will be able to insert the row. Change-Id: I025aaf89d64f47466f1ba4c5bb8178317277ec2c Signed-off-by: Richard Mansfield <[email protected]> -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. https://bugs.launchpad.net/bugs/891170 Title: race conditions in cron Status in Mahara ePortfolio: Fix Committed Bug description: Thanks to tim hunt at the OU for pointing the first issue out: It's possible for cron_lock to fail to get the $started value if the row has been deleted between attempting to insert the record, and attempting to retrieve the start date http://gitorious.org/mahara/mahara/blobs/master/htdocs/lib/cron.php#line488 Additionally, when we try to restart a job which has been running for > 24 hours, we should probably call cron_lock() rather than insert_record() http://gitorious.org/mahara/mahara/blobs/master/htdocs/lib/cron.php#line498 That said, we're very unlikely to ever hit this given the use of cron. To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/891170/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

