Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding error detected #15

Closed
mhussein67 opened this issue Jun 25, 2021 · 3 comments
Closed

Coding error detected #15

mhussein67 opened this issue Jun 25, 2021 · 3 comments

Comments

@mhussein67
Copy link

Hi
The adhoc job produces the below error, please help

Adhoc task failed: tool_deletecourses\task\delete_courses_task,Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
/var/www/html/myportal.acm.edu.kw/admin/tool/deletecourses/classes/task/delete_courses_task.php on line 108

Code should look like:

$factory = \core\lock\lock_config::get_lock_factory('type');
$lock = $factory->get_lock(Resource id #1272);
$lock->release(); // Locks must ALWAYS be released like this.

@mackensen
Copy link
Contributor

@mhussein67 is it possible for you to enable debugging and re-run? The lock failure means something went wrong, but it's a symptom and not the cause.

@bfriesenvcc
Copy link

We are getting similar for plugin v3.9.0 (2022041200) for Moodle 3.9.17. Everything worked great and then it came to a grinding halt.

Execute adhoc task: tool_deletecourses\task\delete_courses_task
... started 10:08:04. Current memory use 64.7MB.
... used 696 dbqueries
... used 0.33661603927612 seconds
Adhoc task failed: tool_deletecourses\task\delete_courses_task,Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
/data/shares/myschool/moodle-3.9.17/admin/tool/deletecourses/classes/task/delete_courses_task.php on line 109

Code should look like:

$factory = \core\lock\lock_config::get_lock_factory('type');
$lock = $factory->get_lock(a556ff9e35d7dfa4e9a71c372e887bdf196460e2);
$lock->release(); // Locks must ALWAYS be released like this.

@mackensen
Copy link
Contributor

mackensen commented Jul 6, 2023

I'm going to close this in favor of #18, which has more traffic, since it's probably the same underlying issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants