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

Long loading time after saving activities with course completion enabled in course

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • 4.3 regressions
    • Activity completion
    • None

      Hi Moodle community,

      I'm encountering an unusual issue in a Moodle 4.3.1 instance (build 20231211).

      Whenever I enable course completion in a course, every time I attempt to edit an activity such as a forum, task, quiz, etc., after clicking the save button, the page takes between 10 to 20 seconds to load. This happens consistently, regardless of any changes made in the edit form of the activity and only when updating, not when I add the activity.

      If course completion is disabled, the page loads in about 3-4 seconds after saving changes. 

      This behaviour only takes place when the platform is being used by a certain number of users. During classes or in pick hours the delay in this update is more notorious, but the rest of the navigation through the LMS is fast and agile. On the other hand, when there is low traffic, the update can take 4-8 seconds aprox to finish.

      This is an example from the network tab in Chrome:

      I have run MysqlTuner in the database and followed the suggestions to optimize certain tables and make adjustements in Mysql configuration, with no luck.

      I have also enabled slow_query_log and saw that GET_LOCK statements take a lot of time in comparison with other queryes.

      If I monitor DB locks I am able to detect pending locks.

      Enviroment

      OS: ubuntu0.22.04.1

      DB: mysql (8.0.360)    

      PHP: 8.1.27

      Moodle: 4.3.1 (build 20231211)

      I've also searched for recent posts or tracker reports related to the course completion feature, but haven't found anything relevant.

      I haven’t been able to update the code to check if there’s an issue with the version. From what I can see, it looks like the completion module doesn’t properly manage locks in the database.

      Any assistance would be greatly appreciated.

      Thanks and regards,

      Tomas.

            Unassigned Unassigned
            tomasdeamos Tomas De Amos
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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