Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #57271, comment 49


Ignore:
Timestamp:
02/17/2024 06:02:56 AM (15 months ago)
Author:
emilycestmoi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57271, comment 49

    initial v1  
    11I've had this issue pop up in my error logs for some time now and finally spent 30 minutes or so debugging it today. This error is happening for me roughly every 30 minutes on a fairly high traffic site (3000 uniques per day) with DISABLE_WP_CRON = true and wp-cron.php being called */1 (every 1 minute) from crond.
    22
    3 The issue is as described in [#1]. The $cron data being set with update_option('cron', $cron) is the same as the value returned by get_option('cron'). This causes update_option('cron', $cron) to return false which is then interpreted as an error in _set_cron_array().
     3The issue is as described in [#comment:1]. The $cron data being set with update_option('cron', $cron) is the same as the value returned by get_option('cron'). This causes update_option('cron', $cron) to return false which is then interpreted as an error in _set_cron_array().
    44
    55From option.php:
     
    2121}}}
    2222
    23 It looks like the pull from [#1] (https://github.com/WordPress/wordpress-develop/pull/3726) will fix the issue, although I haven't tried it yet. There is no drawback of ignoring the error as it's simply discarding duplicate cron data, but I'm still unsure why get_option('cron') is actually returning the duplicate of what is attempting to be saved in some cases (my initial thought is caching and a race condition?)--this will take more time to investigate. For now I'm going to patch this on my site to stop the error from coming up when duplicate data is saved. I will investigate further when I have time.
     23It looks like the pull from [#comment:1] (https://github.com/WordPress/wordpress-develop/pull/3726) will fix the issue, although I haven't tried it yet. There is no drawback of ignoring the error as it's simply discarding duplicate cron data, but I'm still unsure why get_option('cron') is actually returning the duplicate of what is attempting to be saved in some cases (my initial thought is caching and a race condition?)--this will take more time to investigate. For now I'm going to patch this on my site to stop the error from coming up when duplicate data is saved. I will investigate further when I have time.
    2424
    2525Hopefully the fix gets committed soon.