-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.3.5
-
MOODLE_403_STABLE
Observed recently was a cron container that was cycled during an adhoc task resulting in a task stuck in the "running" state and blocking subsequent tasks of the same class.
The task was left in the "running" state based on the timestarted, pid, and hostname. As no exception is thrown, to be caught by the `run_inner_adhoc_task` try-catch statement, this resulted in no further instances of the same task to run due to it thinking that there was one already in progress despite exceeding the max runtime setting.
Proposed solution would be to check currently running tasks against the `task_adhoc_max_runtime` setting within the `\core\task\manager::get_next_adhoc_task` function, and if the task has exceeded this (plus a small margin of error) mtrace the failed adhoc task and trigger the `\core\task\manager::adhoc_task_failed($task);`