[wp-trac] [WordPress Trac] #9388: safety guard for publish_future_post

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 24 18:38:52 GMT 2009


#9388: safety guard for publish_future_post
--------------------------+-------------------------------------------------
 Reporter:  hailin        |       Owner:  anonymous 
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:            
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 There were reports that scheduled future post won't publish.
 And once it missed the scheduled time, the Edit=>post admin page
 display orange "Missed Schedule". However, there is no other trace left to
 determine what happened. There is no cron entry left in the options table.

  I've been tracing this bug for a few weeks.
 And have determined that for a missed schedule, spawn_cron() is never
 called in the first place. That means the cron entry wasn't in the table.

 For two possible reasons:

 1. cron entry wasn't successfully added when user first schedule a post.
 Eg, network timed out, db issue. However, post_date, post_date_gmt were
 modified in db. So user would perceive the post has been successfully
 schduled, although cron entry wasn't there.

 2. cron entry was erased in one of the many _transition_post_status
 And it wasn't added back while the post_status is 'future'

 I've spent many hours trying to reproduce it without luck.

 It usually happens on busy sites with thousands of daily page views.
 and it happens rather randomly. Such as once per week.

 So there is a need to make sure when we display "Scheduled for..",
 there is indeed a cron entry there. Add it if not.
 This at least fixes case 1.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9388>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list