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

Forum cron sends duplicate digest emails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Major Major
    • None
    • 1.9.5, 2.3.6, 2.6.4
    • Forum
    • MOODLE_19_STABLE, MOODLE_23_STABLE, MOODLE_26_STABLE

      The forum_cron() function sends digest emails at the configured time and once all emails are sent it updates the 'digestmailtimelast' config setting to indicate when it last ran. In large deployments where most users have digest enabled (eg. ~10k users), the sending of digest emails can take longer than 5 minutes. If another cron process starts up before the 'digestmailtimelast' setting is updated, it will begin sending duplicate digest emails. Depending on how long the sending takes, there can be 2, 3, or more copies of digest emails sent.

      My attached patch works around this problem by updating 'digestmailtimelast' before beginning to send. Potentially this could cause digests to be lost if the cron process was killed before all emails were sent, but at the moment I'm running this code as its better than having the duplicates. A more robust solution might require each record in the forum queue to be marked as the email gets sent.

            dobedobedoh Andrew Lyons
            ashleyholman Ashley Holman (Inactive)
            Votes:
            13 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

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