Affects Version/s: 3.7
Fix Version/s: 3.7
- install https://github.com/brendanheywood/moodle-tool_sessionbreaker
- Add $CFG->debugsessionlock = 5; to config.php
- Run this command and watch the number of items in the session:
watch -n 1 "curl -b /tmp/cookies.txt -c /tmp/cookies.txt -v http://moodle.local/admin/tool/sessionbreaker/sessionwatcher.php"
SIZE OF SESSION->recentsessionlocks: 6
Without the patch, this will just grow forever.To reproduce: install https://github.com/brendanheywood/moodle-tool_sessionbreaker Add $CFG->debugsessionlock = 5; to config.php Run this command and watch the number of items in the session: watch -n 1 "curl -b /tmp/cookies.txt -c /tmp/cookies.txt -v http://moodle.local/admin/tool/sessionbreaker/sessionwatcher.php " eg SIZE OF SESSION->recentsessionlocks: 6 Without the patch, this will just grow forever.
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
There is an edge case bug with the new feature in
The session history cleanup is looking for 'gaps' in the history, but if you constantly ping a url then it never creates gaps, and even though there may not actually be session lock overlaps it still keeps the history around which grows unbounded.
Solution is some combination of making the cleanup a little more strict. Some ideas:
1) make the gap smaller, eg 1 second
2) cull old history when the cumulated gaps > 1 second
3) have a hard cutoff of maximum stored history, something like 50 urls