-
Bug
-
Resolution: Fixed
-
Minor
-
2.7.3, 2.8
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MDL-49740-locking-bugs -
Today I was debugging an task api issue and was trying to use the admin/tool/task/cli/schedule_task.php CLI to debug what was going on.The CLI was complaining about lock's not being released and showing fairly useless stack trace.
After a bit of digging I added some extra debugging info into the locking factory for postgres which clearly shows where the original lock was created and show this in lock::__destruct so that it's obvious exactly where the coding error is. As it turns out it's actually the schedule_task.php which wasn't releasing the cron lock properly when the task lock fails.
In addition to this the auto_release methods in both db factory classes then create new lock objects and don't release them which further obfuscates the stacks and error messages.
I'll have a patch ready shortly with adds the debugging to all of the various lock factories, fixes the auto_release bug and also fixes the cli script bug.