[AMOS commit] MDL-78580 report_statistics: Prevent database deadlocks when viewing Committed into Git: 2023-09-13 08:31 UTC

[AMOS commit] MDL-78580 report_statistics: Prevent database deadlocks when viewing Committed into Git: 2023-09-13 08:31 UTC

by AMOS bot -
Number of replies: 0
Author: Mark Johnson
MDL-78580 report_statistics: Prevent database deadlocks when viewing
If a quiz had a long job to calculate statstics running, this would
cause pages that may also attempt a recalculation (the statistics report
page or question bank) to load very slowly, and possibly result in a
database deadlock.

This change will firstly prevent the question bank page performing
analysis calculations at all, since these are not required for this
page, which will speed up loading and prevent deadlocks on this page.

Secondly, this adds a lock to the recalcuation process so that it cannot
run twice concurrently. This will present the user with a message to
indicate that it is waiting for a running calculation until it is
complete, and eventually it will timeout with a message and debugging.


http://git.moodle.org/gw?p=moodle.git;a=commit;h=e6b80e155b9efba61fb1ac4c578c92c0fbac1e5e
http://github.com/moodle/moodle/commit/e6b80e155b9efba61fb1ac4c578c92c0fbac1e5e

+ 4.1 en [getstatslockprogress,quiz_statistics]
+ 4.1 en [getstatslocktimeout,quiz_statistics]
+ 4.1 en [getstatslocktimeoutdesc,quiz_statistics]
+ 4.1 en [nostats,quiz_statistics]