Opened 4 years ago
Closed 4 years ago
#9318 closed defect (bug) (fixed)
wp_reschedule_event peggs CPU when very old timestamp is passed in as argument
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.8 |
| Component: | Administration | Version: | 2.7 |
| Severity: | major | Keywords: | has-patch tested |
| Cc: |
Description
Somehow a wp-cron timestamp got create/set with a very old timestamp of 1070. I am sure there is a bug elsewhere that caused this but now that it has happened, WordPress does not recover very gracefully. The result is that when wp_reschedule_event is called, the CPU pegs as it tries to increment it by the $interval until eventually it times out. This causes wp-crop to fail from then on. A possible solution is to set it to time() + $interval instead of incrementing. Or only increment if $timestamp < time() - (2 * $interval).
Attachments (1)
Change History (4)
comment:1
natethelen — 4 years ago
Denis-de-Bernardy — 4 years ago
- Keywords has-patch tested added; wp-cron wp_reschedule_event removed
- Milestone changed from Unassigned to 2.8
Note: See
TracTickets for help on using
tickets.

Here is the change I made which cleaned up the problem. I replaced:
with:
This keeps the $timestamp in line with the difference from time() just like incrementing does, but without having to loop