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

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      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.

        Attachments

        1. MDL-62440.PNG
          130 kB
          Anna Carissa Sadia

          Issue Links

            Activity

              People

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                timhunt Tim Hunt
                Peer reviewer:
                Jason Platts
                Integrator:
                Jake Dallimore
                Tester:
                Anna Carissa Sadia
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jul/18

                  Time Tracking

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