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

Lock Factory and Application Cache incorrectly always enables performance debugging

XMLWordPrintable

    • MOODLE_401_STABLE
    • MDL-76506_m41
    • Hide

      For the existing code to be "off", MDL_PERF must fail the defined() check and perfdebug must be 0. This is not possible, because the UI sets perfdebug to either 7 or 15.

      So to test that this fix is not introducing a new issue:

      1. In the Admin settings, under Development, make sure "Performance info" (perfdebug) is checked.
      2. Visit any course page.
        • The performance info section (large grey box) should display at the bottom
      3. Click the 'Purge all caches' link (this will cause it to rebuild the course modinfo cache).
      4. Look at the performance info section on the resulting course page.
        • There should be a table headed 'Lock' showing at least one lock (probably three) with the time spent waiting for the locks, probably 0.0 seconds.
      5. In the Admin settings, under Development, make sure "Performance info" (perfdebug) is not checked.
      6. Visit any course page
        • The performance info section should not be displayed.
      Show
      For the existing code to be "off", MDL_PERF must fail the defined() check and perfdebug must be 0. This is not possible, because the UI sets perfdebug to either 7 or 15. So to test that this fix is not introducing a new issue: In the Admin settings, under Development, make sure "Performance info" (perfdebug) is checked. Visit any course page. The performance info section (large grey box) should display at the bottom Click the 'Purge all caches' link (this will cause it to rebuild the course modinfo cache). Look at the performance info section on the resulting course page. There should be a table headed 'Lock' showing at least one lock (probably three) with the time spent waiting for the locks, probably 0.0 seconds. In the Admin settings, under Development, make sure "Performance info" (perfdebug) is not checked. Visit any course page The performance info section should not be displayed.

      Here's the incorrect code that was recently added to lib/classes/lock/lock_config.php and cache/classes/loaders.php

      if (defined('MDL_PERF') || !empty($CFG->perfdebug)) {

      Here's the correct code that already existed in lib/classes/shutdown_manager.php

      if ((defined('MDL_PERF') && MDL_PERF) || (!empty($CFG->perfdebug) && $CFG->perfdebug > 7)) {

       

        1. 401.gif
          401.gif
          2.38 MB
        2. Master.gif
          Master.gif
          1.71 MB

            jrchamp Jonathan Champ
            jrchamp Jonathan Champ
            Paul Holden Paul Holden
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 10 minutes
                3h 10m

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