Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#49520 closed defect (bug) (duplicate)

Feature request: Migrate cron from a single serialized wp_options entry to its own table

Reported by: archon810 Owned by:
Priority: normal Milestone:
Component: Cron API Version: 5.3.2
Severity: major Keywords:
Cc: Focuses:

Description (last modified by SergeyBiryukov)

For as long as I can remember using WordPress, its Achilles heel has been cron.

cron is a single serialized entry in wp_options, and on busy sites is subject to race conditions that oftentimes continuously overwrite the cron value with outdated data, resulting in:

  1. completed events coming back (and thus running more than once)
  2. arguably worse, schedule_single_event() losing events because they're overwritten

The latter specifically has long been responsible for the infamous "missed schedule" issue in WordPress - a critical functionality of publishing posts at a certain time being completely unreliable.

#39924, #41965, etc.

​https://github.com/humanmade/Cavalcade needed to be created to properly resolve this, but it's a 3rd party solution that isn't as trivial to set up as activating a plugin, and shouldn't be necessary in well-designed software. I see the cron problem as WordPress's biggest and most glaring flaw, and I'm sure many would agree.

So, what's the solution? Can cron be migrated into its own wp_cron table and the related functions made to interact with the migrated data transparently to the user? I know it'd be a pretty big project, but it's one of those bandaids that just needs to be finally ripped off.

#15148 was closed as wontfix, but I hope the team can reconsider.

Thank you.

Change History (4)

#1 @SergeyBiryukov
7 years ago

  • Description modified (diff)

#2 @archon810
7 years ago

Any thoughts so far?

#3 @peterwilsoncc
7 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

I'm going to close this as a duplicate of #15148.

I still consider modifying the Cron storage mechanism plugin territory. For many typical WordPress sites, modifying the storage mechanism may result in a negative performance impact due to the additional database queries.

As you've pointed to Cavalcade, it's worth noting the ​plugin can be used to modify the storage mechanism without the need for the ​runner.

To continue using the WordPress loopback requests, you'd need to define define( 'DISABLE_WP_CRON', false ); in your wp-config file, I'd also suggest this ​mini-plugin as a little sugar to reverse a Cavalcade design decision.

This ticket was mentioned in ​Slack in #core by takahashi_fumiki. ​View the logs.


6 years ago

Note: See TracTickets for help on using tickets.