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

Cron performance problems after upgrading to Moodle 2.2.x

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.3
    • Component/s: Roles / Access
    • Labels:
      None
    • Testing Instructions:
      Hide

      1. Make a test script like

      <?php
      require_once('config.php');
      context_helper::build_all_paths(true);
      echo 'done';

      run it, and verify that there are no errors.

      2. Change the 'true' to 'false', and run the script again.

      3. Go in to the context table, find two rows with contextlevel = 30 (user). In one set depth to 0, and in the other set path to NULL. Run the 'false' version of the test script again. Make sure it sets the data back to the correct values.

      4. Again, edit rows in the user table, but set depth to something silly, like 100, and path to a random string. Run the 'true' version of the test script again. Make sure it sets the data back to the correct values.

      Show
      1. Make a test script like <?php require_once('config.php'); context_helper::build_all_paths(true); echo 'done'; run it, and verify that there are no errors. 2. Change the 'true' to 'false', and run the script again. 3. Go in to the context table, find two rows with contextlevel = 30 (user). In one set depth to 0, and in the other set path to NULL. Run the 'false' version of the test script again. Make sure it sets the data back to the correct values. 4. Again, edit rows in the user table, but set depth to something silly, like 100, and path to a random string. Run the 'true' version of the test script again. Make sure it sets the data back to the correct values.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Cron and accesslib.php were both changed substantially in Moodle 2.2.

      One bit in particular has been causing us problems since we upgraded from 2.1.x this morning. In cron-lib, there are now calls to

      context_helper::cleanup_instances(); // Line 149 of lib/cronlib.php
      context_helper::build_all_paths(false); // Line 151 of lib/cronlib.php
      context_helper::create_instances(); // Line 183 of lib/cronlib.php

      At least one of thase calls was bringing down our server, but we are not 100% sure which. We commented out all three lines of code, and now running cron does not bring down the server, and we don't really want to experiment enabling them one at a time, and see which crashes our live systemwink

      See http://moodle.org/mod/forum/discuss.php?d=199830 for more info.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/12