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

Release cron locks on abnormal script termination (if possible)

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.0.2, 3.4
    • None
    • Tasks
    • MOODLE_30_STABLE, MOODLE_34_STABLE

    Description

      If a cron job is killed while running a scheduled task, it leaves an open lock on the task. In the case of the database lock factory, and probably others, it's a whole day before this lock is released, so the task is effectively disabled for a day.

      Where the PCNTL functions are enabled in PHP, it would be possible to register a handler for SIGTERM, SIGINT and SIGKILL that would mark the task as failed before exiting and prevent this problem.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              maherne Michael Aherne
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: