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

/admin/tool/task/runningtasks.php can falsely report tasks which are not running

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • 3.11.2
    • Tasks
    • MOODLE_311_STABLE

    Description

      If a process is hard killed for whatever reason, the running tasks data has invalid metadata left behind which makes it look like the task is still running.

      It is very easy to reproduce doing a double Control-C on the cron.php cli, or a kill -9

      I hit this same problem in the lockstats plugin which is now more or less redundant, and the way I fixed this there is looping through the list of theoretically running tasks and re-trying to gain their lock with a 0 timeout. If you didn't get the lock then you know its running (which does assume you have a decent lock implementation) . If you get the lock then you know it isn't running and you can clean up the metadata.

      So we can do this lock api double check either on the runningtasks.php page in realtime. The act of rerunning the same task does appear to auto heal the metadata, so it is tasks that run once a day or once a week which appear incorrect most of the time.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              brendanheywood Brendan Heywood
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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