Apologies in advance if this is not the appropriate forum (please direct me to appropriate forum if that is the case)
On a fairly regular basis, when sending user notification to users via cron job, they fail with following error:
Execute adhoc task: mod_forum\task\send_user_notifications
... started 16:46:04. Current memory use 28MB.
Sending messages to 1814703 (95988)
!!! Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
[dirroot]\lib\cronlib.php on line 154
Code should look like:
$factory = \core\lock\lock_config::get_lock_factory('type');
$lock = $factory->get_lock(Resource id #1538);
$lock->release(); // Locks must ALWAYS be released like this.
When this happens the rest of scheduled task or ad-hoc tasks won't run until process time's out ( presume this related to site admin>server>task>task processing setting i.e. as hoc task runner lifetime?) Trouble is when Cron starts running again, it will work until it hits another one of these notifications.
The same job runs fine when I run it via CLI:
I am just wondering where else to look (apologies but our main Moodle Admin\developer has suddenly left) so seeing what else I can do to help diagnose the issue.
Thanks in advance.