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

Large number of backups stop forum notifications

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Done
    • Minor
    • None
    • 3.9 regressions, 3.9.17, 3.10.6, 3.11.10, 4.0.4
    • Tasks
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Hide
      1. Setup requirements:
        • Moodle instance with appropriate Version (3.9, 3.11, 4.0)
        • Database access for said Moodle instance
      2. Ensure automated backup is activated (backup_auto_active)
      3. Ensure automated backup is set to a point in the near future (backup_auto_weekdays, backup_auto_hour).
      4. Ensure enough courses are eligible for backup:
        • Total of >2500 courses should be included in any one run.
        • Courses should have some complexity so the queue is not emptied too quickly.
        • Disabling backup_auto_skip_hidden should help.
        • Setting backup_auto_skip_modif_days to "Never" should help.
        • Disabling backup_auto_skip_modif_prev should help.
      5. Ensure the automated backup scheduled task has run and added enough courses to backup to the adhoc task queue
        • Verify this by running the following SQL query:
          SELECT count(id), component, classname, faildelay, min(from_unixtime(nextruntime)) as next, nextruntime FROM mdl_task_adhoc GROUP BY classname, faildelay ORDER BY next;
          The class \core\task\course_backup_task should have a count of more than 2000 for this error to occur.
      6. Send a forum notification without waiting for the editing delay. This should normally send the notification instantly but will fail to do so while the adhoc queue has still more than 2000 entries of the course backup class. Verify that the notification does not arrive within a reasonable timeframe.
      7. Verify that forum notifications arrive (in bulk) once the count of the course backup class (see above SQL query) drops below 2000.

      Testing instructions for fix:

      1. As above, however verify that forum notifications arrive regardless of course backup class count in table mdl_task_adhoc (see above SQL query).
      Show
      Setup requirements: Moodle instance with appropriate Version (3.9, 3.11, 4.0) Database access for said Moodle instance Ensure automated backup is activated (backup_auto_active) Ensure automated backup is set to a point in the near future (backup_auto_weekdays, backup_auto_hour). Ensure enough courses are eligible for backup: Total of >2500 courses should be included in any one run. Courses should have some complexity so the queue is not emptied too quickly. Disabling backup_auto_skip_hidden should help. Setting backup_auto_skip_modif_days to "Never" should help. Disabling backup_auto_skip_modif_prev should help. Ensure the automated backup scheduled task has run and added enough courses to backup to the adhoc task queue Verify this by running the following SQL query: SELECT count(id), component, classname, faildelay, min(from_unixtime(nextruntime)) as next, nextruntime FROM mdl_task_adhoc GROUP BY classname, faildelay ORDER BY next; The class \core\task\course_backup_task should have a count of more than 2000 for this error to occur. Send a forum notification without waiting for the editing delay. This should normally send the notification instantly but will fail to do so while the adhoc queue has still more than 2000 entries of the course backup class. Verify that the notification does not arrive within a reasonable timeframe. Verify that forum notifications arrive (in bulk) once the count of the course backup class (see above SQL query) drops below 2000. Testing instructions for fix: As above, however verify that forum notifications arrive regardless of course backup class count in table mdl_task_adhoc (see above SQL query).

    Description

      If there are 2000 or more backups listed in the task_adhoc table, processing of other adhoc tasks like forum notifications stops. This is the result of a hard coded limit in lib/classes/task/manager.php. In particular, the line

      $records = $DB->get_records_select('task_adhoc', $where, $params, 'nextruntime ASC, id ASC', '*', 0, 2000);

      limits the number of adhoc tasks that will be examined without considering the task concurrency limits. So, if there are a large number of backups in the queue, that select statement may only return them. In my case, increasing the limit to 4000 solved the issue, but I wouldn't view that as the perfect solution.

      Attachments

        Issue Links

          Activity

            People

              Votes:
              10 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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