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

Accessing grades in any activity with grades trigers infinite loop if there are unresolved references in grade calculations

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • 3.5.4, 3.6
    • Gradebook, Performance
    • None
    • MOODLE_35_STABLE, MOODLE_36_STABLE

    Description

      If there are unresolved references in grade calculations, accessing grades in any activity with grades triggers infinite loop. Moodle site becomes unresponsive until the timeout of http server or fpm-php kills the resulting process.

      The same behavior in appears in moodle versions 3.5 and 3.6. It is not limited to qradebook, but affects all activities, that can be graded. The consequences are grave. The gradebook and any activity that can be graded become inaccessible in the affected course.

      In version 3.1 this seems to be fixed as the gradebook reports an error, and do not try to calculate all the grades and possibly exaust all the resources.

      The behavior is realy nasty, since any activity that can be graded in the affected course spawns a php proccess that uses 100% cpu and runs until the timeout and consequently few such request can exaust the CPU resources and can make the whole moodle site inaccessible.

      The affected versions are 3.5 and 3.6. This was tested on Moodle 3.6.2+ (Build: 20190118) and Moodle 3.5.4 (Build: 20190114).

      Steps to reproduce:

      create an activity say Quiz1
      label Quiz1 with say quiz1 in gradebook
      add calculation that contains [[quiz1]] eg =[[quiz1]]
      delete Quiz1
      wait for cli to clean up Quiz1
      visit gradebook or another quiz attemts

      Possible workaround:

      Course administration (wheel icon) -> More... -> Reset -> Gradebook -> Delete all items and categories

      Related to MDL-51360

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              martinv Martin Vuk
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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