Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Forum
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      33657

      Description

      Another thing: I was so lucky because get the daily send of digest mails in action. And this line:

      if ($digestposts = get_records('forum_queue')) {

      just crash if there are too many records in the table (right now one server has more than 800.000!).

      I would propose to:

      • Change code to use one recordset.
      • Add one more query to delete old records say, one week, at the begining of the forum cron. just to avoid current and future accumulation!
      • Add some trace message about the digest process starting (was impossible to detect if before!).

      And this is the called DIGEST_CRON_PROBLEM from now.

      I continue advancing...

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          Ah! great! I guess it got so big only because of the other issues stopping it getting so far.

          Show
          Martin Dougiamas added a comment - Ah! great! I guess it got so big only because of the other issues stopping it getting so far.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          If you aren't working on this, I had planned to start this today (implementing the 3 points above).

          Just confirm, plz. Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - If you aren't working on this, I had planned to start this today (implementing the 3 points above). Just confirm, plz. Ciao
          Hide
          Martin Dougiamas added a comment - - edited

          Oh please do if you have time! I'll check back later on and do it if you haven't.

          Show
          Martin Dougiamas added a comment - - edited Oh please do if you have time! I'll check back later on and do it if you haven't.
          Hide
          Martin Dougiamas added a comment -

          I can't see any changes here, so I'm going to work on this now.

          Show
          Martin Dougiamas added a comment - I can't see any changes here, so I'm going to work on this now.
          Hide
          Martin Dougiamas added a comment -

          I've added a new timemodified field and added a delete_records_select() to trim the old ones.

          Show
          Martin Dougiamas added a comment - I've added a new timemodified field and added a delete_records_select() to trim the old ones.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Oki. I'll try to enclose it in a recordset if possible ASAP. Not critical but better.

          Show
          Eloy Lafuente (stronk7) added a comment - Oki. I'll try to enclose it in a recordset if possible ASAP. Not critical but better.
          Hide
          Paolo Oprandi added a comment -

          I got an email digest from this forum for the first time since late August on Oct 10th 08:11 BDT, but I haven't received anything since.

          Ciao,
          Paolo
          p.s Martin D, if you are reading this I commented on RLJ-576372

          Show
          Paolo Oprandi added a comment - I got an email digest from this forum for the first time since late August on Oct 10th 08:11 BDT, but I haven't received anything since. Ciao, Paolo p.s Martin D, if you are reading this I commented on RLJ-576372
          Hide
          Martin Dougiamas added a comment -

          Sorry, Eloy ... if you have a moment to run a cron manually, could you check?

          To send that first one manually I changed this line in mod/forum/lib.php:

          if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) {

          to

          if (true) {

          So if it's not working still, then I suspect the logic in that line is not working.

          However, I just changed it again and the script exited with Error 255 ....

          However, I haven't time to look into this further (travelling) .... can you check?

          Show
          Martin Dougiamas added a comment - Sorry, Eloy ... if you have a moment to run a cron manually, could you check? To send that first one manually I changed this line in mod/forum/lib.php: if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) { to if (true) { So if it's not working still, then I suspect the logic in that line is not working. However, I just changed it again and the script exited with Error 255 .... However, I haven't time to look into this further (travelling) .... can you check?
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Checking this... trying to run some manual invocations as suggested. Relax!

          Show
          Eloy Lafuente (stronk7) added a comment - Checking this... trying to run some manual invocations as suggested. Relax!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          if I tried the "if (true)" approach and the disgest part hasn't be executed at all!

          The key here is that, if there are a lot of forum->posts, memory grows and grows beyond limit (due to MDL-11658) and the process die in the middle of the "normal" (non-digest) send of mail.

          So I'm going to mark this as "fixeable by MDL-11658". Also there are some minor improvements in the "digest" part (some recordsets here and there) but we need the memory problem fixed before anything else.

          Until then, I'm going to raise the memory limit a bit - moodle,org only (to be able to finish the forum cron execution often).

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - if I tried the "if (true)" approach and the disgest part hasn't be executed at all! The key here is that, if there are a lot of forum->posts, memory grows and grows beyond limit (due to MDL-11658 ) and the process die in the middle of the "normal" (non-digest) send of mail. So I'm going to mark this as "fixeable by MDL-11658 ". Also there are some minor improvements in the "digest" part (some recordsets here and there) but we need the memory problem fixed before anything else. Until then, I'm going to raise the memory limit a bit - moodle,org only (to be able to finish the forum cron execution often). Ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Hi Paolo,

          I've changed some bits here and there in digests generation (after having MDL-11658 also fixed by Petr) and moodle.org digests are being sent right now.

          Can you confirm if you've received it and if it's ok? (I forgot to change my preferences to receive digests, grrr). It should contain messages from last 24 hours only.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Hi Paolo, I've changed some bits here and there in digests generation (after having MDL-11658 also fixed by Petr) and moodle.org digests are being sent right now. Can you confirm if you've received it and if it's ok? (I forgot to change my preferences to receive digests, grrr). It should contain messages from last 24 hours only. TIA and ciao
          Hide
          Eloy Lafuente (stronk7) added a comment - - edited

          Oki,

          I'm going to close this because I've received digests last two days.
          Also, I've implemented and tested (today in moodle.org) one small change, moving this line:

          set_config('digestmailtimelast', $timenow);

          to the end of the loop, allowing digests to continue in next cron execution if something has failed in the previous one. It should be 100% safe because each iteration deletes the records from the queue before processing them, so no duplicates - nor getting stuck forever in one user - are possible at all.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - - edited Oki, I'm going to close this because I've received digests last two days. Also, I've implemented and tested (today in moodle.org) one small change, moving this line: set_config('digestmailtimelast', $timenow); to the end of the loop, allowing digests to continue in next cron execution if something has failed in the previous one. It should be 100% safe because each iteration deletes the records from the queue before processing them, so no duplicates - nor getting stuck forever in one user - are possible at all. Ciao
          Hide
          Sebastian Sosi?ski added a comment - - edited

          Hello

          I have the same problem on 1.8.3+ (version 17 November).

          Please write me what I must to do.

          Thanks

          CRON send only one mail to one person (digest mail). After this action, cron.php is halt.

          Show
          Sebastian Sosi?ski added a comment - - edited Hello I have the same problem on 1.8.3+ (version 17 November). Please write me what I must to do. Thanks CRON send only one mail to one person (digest mail). After this action, cron.php is halt.

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: