[wp-trac] [WordPress Trac] #51716: WP Cron - looses entries

WordPress Trac noreply at wordpress.org
Mon Nov 16 21:18:52 UTC 2020


#51716: WP Cron - looses entries
-------------------------------+------------------------------
 Reporter:  Nate1              |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Cron API           |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  performance
-------------------------------+------------------------------

Comment (by Nate1):

 Replying to [comment:1 johnbillion]:
 > Thanks for the report, @Nate1.
 >
 > To address your last point first, yes this is how the WP-Cron event
 system works. [https://developer.wordpress.org/plugins/cron/ Info about
 WP-Cron here] and [https://developer.wordpress.org/plugins/cron/hooking-
 wp-cron-into-the-system-task-scheduler/ info about how to use system cron
 here].
 >
 > Scheduling multiple events in quick succession from a single process
 shouldn't be an issue. If you are seeing this problem then it would be
 great if you can provide some more information, a code example,
 information about your caching configuration, etc.
 >
 > Scheduling multiple events simultaneously from more than one process --
 for example when two requests hit your server at the same time or via two
 separate Ajax or REST API calls -- can indeed fail or overwrite one
 another due to the inherent problem caused by all events being stored in a
 single option that leads to a race condition with the read-then-write
 operations that the event scheduling functions perform.
 [https://github.com/johnbillion/wp-crontrol/wiki/Cron-events-that-have-
 missed-their-schedule I maintain some info about this here].


 I can see it doesn't work, what I find a little troubling is that rather
 largely limited feature this seems to be acceptable?

 Even with disabling the cron system, such as
 https://www.hostgator.com/help/article/how-to-replace-wordpress-cron-
 with-a-real-cron-job leaves the the same problem that two simultaneous
 requests could loose a cron task? The only solution being having to
 rebuild the wheel to have a reliable piece of software?

 If this is something you've built, please don't be offended I do
 appreciate the work done and in part has served some purpose, but I would
 like to see a more robust implementation and am happy to help if needed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51716#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list