Hi everybody,
we are using a scheduled task since months and upgraded from Moodle 4.1 to Moodle 4.5 recently. I am not sure if this is related to the Moodle upgrade, however, we are facing an inexplicable problem.
One of our tasks is started regularly using the scheduled_tasks.php every 30 seconds (syncs data between two systems as fast as possible). The task itself executes without any errors. Most of the times it takes only millieconds to run, but sometimes it takes about half an hour. Should be no problem, as the documentation of the scheduled_tasks.php says: "Runs a single scheduled task immediately - regardless of scheduling settings. This will even run disabled tasks. Tasks will still use locking to prevent concurrent execution of the same task - even on clusters. The format of the <task> argument must be the same as returned by the --list option above"
As already mentioned, we had no problems with this setup for 2 years!
The problem started two days ago, when the execution of scheduled_task.php caused an increase of the faildelay because there was already another instance of the task running. It reported, that it cannot start the task because of the locking. By design, Moodle should just prevent parallel execution, but not consider this as an error. After the original process had finished, the faildelay was set to 0 again and everything was fine. The same phenomenon occurred again today.
We do not understand this new behavior of Moodle and it seems to contradict the documented software design. Additionally in the meanwhile the faildelay reaches the maxfaildelay value and our Moodle sends an error-message to all admins two times a minute. We further do not understand, why Moodle sends this email repeatedly. Such a notification makes only sence to be sent once.
Has anybody a hint for me, what can cause this misbehaviour of our Moodle system?
Thanks for your time and advise
Robert