Opened 6 years ago
Closed 6 years ago
#41098 closed defect (bug) (duplicate)
Some cron scheduling events are ignored
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Cron API | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
The problem appears when two different events are scheduled at the same time.
It's a bit hard to reproduce, but if one plugin is continuously scheduling events (e.g. recurrent schedule every 5 mins, but they execute for 5 mins), another plugin's scheduling events might be completely ignored.
I believe this is because there is no lock mechanism in the schedule functions where we write to the cron
option in the database.
What happens in the code is:
Continuous (plugin #1): wp-cron.php has wp_unschedule_event
in a loop (which may overwrite cron
option in the database)
Random (plugin #2): Call wp_schedule_event
to update cron
option, but plugin #1 may have overwritten it already.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
I was told there is a possibility a similar issue exists (https://wordpress.slack.com/archives/C02RQBWTW/p1497894482517202?thread_ts=1497891360.458419&cid=C02RQBWTW) but I couldn't find it when searching.
If that turns out to be the case, please close this as duplicate.
Otherwise, I provided a proof of concept diff.