Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.9.14, 3.10.11, 3.11.7, 4.0.1, 4.1
-
None
-
None
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
-
Description
If you start the import of a course, but stop just after the category selection page and you quit this import without pressing the "cancel" button, then in base there will remain a course with the name "Course restoration in progress copie X", with X is a counter.
If this operation is repeated hundreds of times, we end up with hundreds of lines in the base for nothing.
The more lines there are, the longer the import phase between the selection of the category and the next page will be, because this is when the new name is generated in "Course restoration in progress copie X" format. Indeed to find the right value of the counter at the end of the name, moodle will make two requests on each possible value of the counter until you find the right value.
On my production moodle in 3.9, we had more than 800 courses with a name in the format "Course restoration in progress copie X". Moodle must then make more than 1600 requests to find the right name and this slows down the import enormously, or even triggers timeouts.
I also tested this on a moodle platform in main branch to find that the problem is still present although less impacting.