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

Participants page use of get_users_roles exhausts memory with many site-wide role assignments

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • Hide

      This needs a regression test of the Particiants page (user/index.php). So, perhpas re-run the related MDLQA tests.

      A good specific test that the code change did not cause a regression is:

      1. Logged in as admin, find a course with more than 20 enrolled users.
      2. Go to the participants page (Course administration -> Users -> Enrolled user) for that course.
      3. Verify that the table displays without errors, and that, in particular, the values in the Roles column are right.
      4. Go to the second page of results, and check that too.
      5. For one of the users in the table, assign them a System role (e.g. Manager) using Site administration -> Users -> Permissions -> Assign system roles.
      6. Re-load the particpants table, and verify that the new role shows up.
      Show
      This needs a regression test of the Particiants page (user/index.php). So, perhpas re-run the related MDLQA tests. A good specific test that the code change did not cause a regression is: Logged in as admin, find a course with more than 20 enrolled users. Go to the participants page (Course administration -> Users -> Enrolled user) for that course. Verify that the table displays without errors, and that, in particular, the values in the Roles column are right. Go to the second page of results, and check that too. For one of the users in the table, assign them a System role (e.g. Manager) using Site administration -> Users -> Permissions -> Assign system roles. Re-load the particpants table, and verify that the new role shows up.

      When you view the participants page for any course, it calls get_users_roles with userids = [].

      This means it loads every site-wide role assignment, which in some set-ups (like ours) may be half a million rows.

      The participants page should be changed to pass in only the ids of the users that are about to be displayed.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Jason Platts Jason Platts
            Jake Dallimore Jake Dallimore
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

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