Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0.8, 2.1.5, 2.2.2, 2.3
-
Fix Version/s: 2.3
-
Component/s: Forum, General, Performance
-
Testing Instructions:
-
Difficulty:Easy
-
Affected Branches:MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
Fixed Branches:MOODLE_23_STABLE
-
Pull from Repository:
-
Pull Master Branch:w21_
MDL-32379_m23_forumcron -
Pull Master Diff URL:
Description
The session_set_user function points $_SESSION['USER'] at the passed object.
When data is attached to the session user, this bloats out the referenced object, so if a process changes users many times from say, a prefilled list of records, it will hit the memory limit and fail. For example, the forum digest sending is affected by this problem and will fail on any site where a large number of users are to be sent a digest.
This can be resolved by simply cloning the passed $user object to break the reference.
Github incoming with a patch.