sessions/locking in Moodle

sessions/locking in Moodle

by John Nowlan -
Number of replies: 1

Not being a php person I found this brief article to be the best explanation of sessions in php:
https://ma.ttias.be/php-session-locking-prevent-sessions-blocking-in-requests/

and I see work is being done on: https://tracker.moodle.org/browse/MDL-58018 (very interested!)

but my questions would be (and please correct any misunderstanding):

  • can anyone provide a good overview of how session locking works in Moodle?
  • does moodle take a lock on every REQUEST (GET and POST)?
  • If so, why? Is this historical?
  • shouldn't a lock only be taken explicitly by code that knows it is modifying data (i.e. DB/file writes) not generally?

Appreciate any light that can be shed on this, especially as lock contention is an issue for us.

Thanks,
john

Average of ratings: -
In reply to John Nowlan

Re: sessions/locking in Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Firstly, it depends on what you are using for sessions in Moodle (there are choices)