[wp-trac] [WordPress Trac] #39924: wp_schedule_single_event is possibly failed to schedule a task when it is called concurrently

WordPress Trac noreply at wordpress.org
Wed Feb 26 20:06:03 UTC 2020


#39924: wp_schedule_single_event is possibly failed to schedule a task when it is
called concurrently
--------------------------+------------------------
 Reporter:  hainey        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Cron API      |     Version:
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------

Comment (by archon810):

 On busy sites, like ours, schedule_single_event() is borderline useless
 and extremely unreliable due to the race condition and WP's continued use
 of a single array for wpcron.

 It has resulted in entire sites being brought down when the cron array
 grows in size for whatever reason and the constant reading and
 writing/overwriting brings down databases.

 A simple solution that I'm shocked WP maintainers haven't implemented yet
 would be to move wpcron to its own table, which can then be properly
 interacted with on a row-by-row event-by-event basis. Setting up Cavalcade
 shouldn't be necessary to resolve events getting dropped, resulting in
 missed schedules.

 Why is wp cron still not its own table? Imagine if postmeta was a
 serialized field in wp_posts.

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


More information about the wp-trac mailing list