[wp-trac] [WordPress Trac] #57924: Cron Goes Missing. _set_cron_array called with incorrect number of crons

WordPress Trac noreply at wordpress.org
Thu Mar 16 21:17:21 UTC 2023


#57924: Cron Goes Missing. _set_cron_array called with incorrect number of crons
--------------------------+------------------------------
 Reporter:  j3gaming      |       Owner:  j3gaming
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cron API      |     Version:  6.1.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by j3gaming):

 Question....

 wp-cron.php
 {{{
 /*
  * The cron lock (a unix timestamp set when the cron was spawned),
  * must match $doing_wp_cron (the "key").
  */
 if ( $doing_cron_transient !== $doing_wp_cron ) {
         return;
 }
 }}}


 If another cron is called on exactly the same timestamp (for whatever
 reason) would it bypass the lock? It looks like it would.

 From what I can tell, if anyone visits /wp-cron.php?doing_wp_cron at the
 same moment Linux (or any OS) is doing a system level (real) cron...
 wouldn't that execute everything twice?

 Is there a cleaner way to do this lock?

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


More information about the wp-trac mailing list