- πΈπ°Slovakia poker10
Closing this as it seems like the support request was solved. Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.
i am running a busy drupal commerce site which creates order on a hook_cron based on recurring entities due dates. i notice that once in a while orders are created twice. the only way this could happen is if cron ran at the same time, and the first cron that executed failed(or delayed) to update the cache. i have cron set to tun every hour.
i looked at the code from cron and it seems like system_run_automated_cron() checks for when cron ran last time, and if it's longer that 1 hour, calls drupal_run_cron().this function eventually gets a lock and calls all implementations of hook_cron() . and finally updates the variable which saves the last time cron ran, and releases the lock.
now, if two visitors of my site happen to hit it at the same time, and the first cron hasn't saved the variable storing the last time drupal ran, it is possible that the second (and even more visitors will pass the condition on system_run_automated_cron() and be put on the queue for the lock on drupal_run_cron()
creating a race condition.
so, i am right, is this possible?
if it is, how can i prevent this behavior?
Fixed
7.0 β°οΈ
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Closing this as it seems like the support request was solved. Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.