[wp-trac] [WordPress Trac] #51716: WP Cron - looses entries
WordPress Trac
noreply at wordpress.org
Sat Feb 15 21:42:35 UTC 2025
#51716: WP Cron - looses entries
--------------------------+------------------------------
Reporter: Nate1 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Cron API | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance
--------------------------+------------------------------
Comment (by kkmuffme):
This isn't only an issue due to it being stored as a single object, but
also bc of object caching (even if non-persistent).
If plugin A calls `wp_schedule_event` (or any function that loads the cron
tasks via _get_cron_array()) on e.g. plugins_loaded, and plugin B calls
`wp_schedule_event` later (e.g. shutdown), the option value retrieved
initially is modified. If any other requests modified/scheduled crons in
the meantime, all their scheduled crons are lost - or vice versa if cron
is running at the same time but finishes before we call wp_schedule_event
the 2nd time, it could mean that suddenly old crons that are already
completed will be added back and run a 2nd time.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51716#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list