Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82252

Failure of cron runner causes ad-hoc tasks to be stuck in "running" state

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.3.5
    • Tasks
    • 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);`

            Unassigned Unassigned
            SimonThornett Simon Thornett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.