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

Issues with depending on "Next run" timestamp in scheduled task



    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.8
    • Fix Version/s: None
    • Component/s: Tasks
    • Labels:
    • Affected Branches:


      A few weeks ago, timesync on our Moodle server went all sorts of crazy, and it thought that it was the year 2140. Or 2070. Or about 300 different dates, depending on what minute it was. I ended up having to turn off ntp syncing, and then it straightened itself out.

      The problem with this is that the database stores a "last run time" and "next run time" in the database, so when the cron jobs ran when the timesync was all out of whack, they all ended up with "last run dates" about 150 years in the future, and as a result, "next run dates" at some point after that. So none of the jobs were running.

      There should be some sort of functionality in the system so that if, say, the "next run time" is more than a year in the future (for example,) or if the "last run time" is significantly in the future (aka, more than an hour to prevent issues with daylight savings time,) an alert email gets sent out.

      This could potentially cause a security issue because some necessary scheduled tasks (such as the ones to disable/purge accounts, expire accounts from external sources, etc.,) don't get run when this is the case.




            • Assignee:
              smily03 Chris Myers
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: