Our Moodle version is 3.6.1 installed on CentOS 7.4 and PHP 7.2.16 platform. We held an online 300 students' quiz with answer files uploaded to Moodle. Students failed to login Moodle at the submission time. The Moodle system was overloaded. The error logs show a large number of "Invalid Login Token" together with the error message about Redis session lock.
Below are the error messages of the apache log:
"Invalid Login Token: 182041 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
"Cannot obtain session lock for sid: 436k3ss5bpb7m3jf0228q16lua within 120. It is likely another page has a long session lock, or the session lock was never released."
It is believed that error occurred in Redis session handling. Below is part of the config file of our Redis session handling.
// Redis server v=3.1.2 php-pecl-redis is v3.1.6 for php7.2
// Redis session handler (requires redis server and redis extension):
$CFG->session_handler_class = '\core\session\redis';
$CFG->session_redis_host = '127.0.0.1';
$CFG->session_redis_port = 6379; // Optional.
$CFG->session_redis_database = 0; // Optional, default is db 0.
$CFG->session_redis_prefix = ''; // Optional, default is don't set one.
$CFG->session_redis_acquire_lock_timeout = 120;
$CFG->session_redis_lock_expire = 7200;
I wonder why the session lock was never released. Please advise how to solve the problem.