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

forum cron does not use smtp buffering any more

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Pre-requisites

      1. Setup mailcatcher to keep tabs on the SMTP connections. Andrew Nicols has a branch with more logging (necessary in order to complete this test):
        1. sudo apt-get install ruby1.9.1-dev
        2. cd to your friendly git folder
        3. git clone git@github.com:andrewnicols/mailcatcher.git
        4. cd mailcatcher
        5. git checkout connectionLogging
        6. sudo gem build mailcatcher.gemspec
        7. sudo gem install mailcatcher-0.6.0.gem
        8. mailcatcher -vf # (you will watch this window)
      2. Install failmail
        1. cd mod/ # in your moodle instance
        2. git clone git@github.com:xow/moodle-mod_failmail.git failmail
        3. Go to Home ► Site administration ► Notifications
        4. Follow the prompts to install failmail

      Test

      1. Go to Home ► Site administration ► Plugins ► Message outputs ► Email
      2. Set SMTP hosts to "127.0.0.1:1025"
      3. Set SMTP session limit to 10
      4. Make sure that your browser doesn't auto fill the SMTP username and password. If it does, just delete both. When did they become so over-zealous anyway?
      5. php admin/tool/task/cli/schedule_task.php --execute='\mod_failmail\task\cron_task'
      6. This will send 30 emails. Watch your mailcatcher screen, and check that a new connection is established every 10 emails.

        ==> SMTP: Connected established
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Received message from '<john@moodle.com>' (746 bytes)
        ==> SMTP: Connected closed
        

      Show
      Pre-requisites Setup mailcatcher to keep tabs on the SMTP connections. Andrew Nicols has a branch with more logging (necessary in order to complete this test): sudo apt-get install ruby1.9.1-dev cd to your friendly git folder git clone git@github.com:andrewnicols/mailcatcher.git cd mailcatcher git checkout connectionLogging sudo gem build mailcatcher.gemspec sudo gem install mailcatcher-0.6.0.gem mailcatcher -vf # (you will watch this window) Install failmail cd mod/ # in your moodle instance git clone git@github.com:xow/moodle-mod_failmail.git failmail Go to Home ► Site administration ► Notifications Follow the prompts to install failmail Test Go to Home ► Site administration ► Plugins ► Message outputs ► Email Set SMTP hosts to "127.0.0.1:1025" Set SMTP session limit to 10 Make sure that your browser doesn't auto fill the SMTP username and password . If it does, just delete both. When did they become so over-zealous anyway? php admin/tool/task/cli/schedule_task.php --execute='\mod_failmail\task\cron_task' This will send 30 emails. Watch your mailcatcher screen, and check that a new connection is established every 10 emails. ==> SMTP: Connected established ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Received message from '<john@moodle.com>' (746 bytes) ==> SMTP: Connected closed
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-48224-master
    • Sprint:
      BACKEND Sprint 19
    • Issue size:
      Medium

      Description

      Previously the plugin cron was doing get_mailer('buffer'); and get_mailer('close'); - it is now only in lib/classes/task/legacy_plugin_cron_task.php

      The forum cron is in separate file mod/forum/classes/task/cron_task.php since 2.7.2 and it does not do it any more, this is a performance regression when $CFG->smtpmaxbulk > 1

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Jan/15