At the moment, if the cron script is unable to get the next scheduled task because another instance of the script has the core_cron lock, it terminates with a message something like this:
!!! The operation timed out while waiting for a lock. !!!
|
!!
|
Error code: locktimeout !!
|
!! Stack trace: * line 446 of /lib/classes/task/manager.php: moodle_exception thrown
|
* line 66 of /lib/cronlib.php: call to core\task\manager::get_next_scheduled_task()
|
* line 61 of /admin/cli/cron.php: call to cron_run()
|
!!
|
This looks a lot like there has been a problem, but it seems actually to be expected behaviour. (That is to say, where multiple cron processes are running, it's standard operation for one of them to be able to grab the core_cron lock and prevent the other processes from running any tasks.)
It would be much better if, rather than terminating immediately on the exception being thrown, the script were to terminate as normal - printing "Cron script completed correctly" etc, and doing garbage collection.
- duplicates
-
MDL-50694 Cron message "The operation timed out while waiting for a lock" isn't really an error
-
- Closed
-