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

auth_oauth2 causes all auth plugin lang files to be fetched from the cache.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.8, 3.6.3, 3.7.2, 3.8
    • Fix Version/s: 3.6.7, 3.7.3
    • Component/s: Performance
    • Labels:
    • Testing Instructions:
      Hide

      This is tricky to test as it's a mostly invisible performance fix.  It changes the code that auth_oauth2 uses to check whether its enabled, I have written PHPUnit tests to cover this.

      If its possible, you can do a "before and after" comparison.

      1. Without the patch applied, enable perfdebug, and set the core/string cache to use cachestore_file.
      2. View a course page as a student. Reload the page to ensure caches are primed.
      3. Note the number of cache hits for the core/string cache on cachestore_file (the number before the first slash).
      4. Apply the patch.
      5. Reload the page.
      6. Check the number of cache hits again. It should have reduced by 12 (the number of auth plugins).
      Show
      This is tricky to test as it's a mostly invisible performance fix.  It changes the code that auth_oauth2 uses to check whether its enabled, I have written PHPUnit tests to cover this. If its possible, you can do a "before and after" comparison. Without the patch applied, enable perfdebug, and set the core/string cache to use cachestore_file. View a course page as a student. Reload the page to ensure caches are primed. Note the number of cache hits for the core/string cache on cachestore_file (the number before the first slash). Apply the patch. Reload the page. Check the number of cache hits again. It should have reduced by 12 (the number of auth plugins).
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull 3.5 Branch:
      MDL-65335_35_STABLE
    • Pull 3.7 Branch:
      MDL-65335_37_STABLE
    • Pull Master Branch:
      MDL-65335_master

      Description

      Similar to MDL-65327, the is_enabled function in auth_oauth2 loads all auth plugins in order to check that this one plugin is enabled.  This causes the lang file for all installed plugins to be fetched from the cache, regardless of whether the plugin is ever used.

        Attachments

          Activity

            People

            Assignee:
            marxjohnson Mark Johnson
            Reporter:
            marxjohnson Mark Johnson
            Peer reviewer:
            Andrew Nicols
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Nov/19

                Time Tracking

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