[wp-trac] [WordPress Trac] #17462: Improve cron locking
WordPress Trac
wp-trac at lists.automattic.com
Tue May 17 04:47:15 UTC 2011
#17462: Improve cron locking
--------------------------+-----------------------------
Reporter: ryan | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Cron | Version: 3.1.2
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+-----------------------------
Comment (by Denis-de-Bernardy):
Replying to [comment:3 nacin]:
> Short discussion in IRC with duck_ and ryan led to this suggestion that
I think we all liked: Make the timeout longer and clear the transient when
wp-cron.php completes.
Can't this lead to runaway crons just like the current situation?
Suppose you've a batch of 100k registration emails to send, and a fussy
shared host that kills lengthy processes. Cron A locks and starts sending
emails. The next couple of crons see things are locked so don't start.
Server kills cron A because it's taking too long. Cron B locks and starts
sending emails (to the same people). The next couple of crons see things
are locked (etc.).
To avoid the problem, locking needs to be done for individual cron jobs,
rather than as a group. This would allow to mark individual items as being
locked/in progress, and concurrent crons could then kick in and process
other items accordingly.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17462#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list