-
Bug
-
Resolution: Fixed
-
Minor
-
3.9
-
MOODLE_39_STABLE
-
MOODLE_39_STABLE
-
read-only-session
-
I'm not too sure on this as a patch, but it resolves the issue.
On startup, the mobile app does a POST as:
curl -X POST 'http://localhost/lib/ajax/service.php?info=tool_mobile_get_public_config&XDEBUG_SESSION_START=VSCODE' -d '[\{"siteUrl": "http://localhost", "index": 0, "methodname":"tool_mobile_get_public_config", "args":{}}]'
If read-only sessions and redis are enabled, this hits the handler_read() function.
In there, if finds there is not yet a session in redis, then, if write-lock is needed, returns '' else returns false.
Since false is returned, we throw later on.
diff --git a/lib/classes/session/redis.php b/lib/classes/session/redis.php
|
index ff11a66129..f2da4525b0 100644
|
--- a/lib/classes/session/redis.php
|
+++ b/lib/classes/session/redis.php
|
@@ -257,8 +257,10 @@ class redis extends handler {
|
$this->lock_session($id);
|
}
|
$sessiondata = $this->connection->get($id);
|
- if ($sessiondata === false && $this->requires_write_lock()) {
|
- $this->unlock_session($id);
|
+ if ($sessiondata === false) {
|
+ if ($this->requires_write_lock()) {
|
+ $this->unlock_session($id);
|
+ }
|
return '';
|
}
|
$this->connection->expire($id, $this->timeout);
|
- has a non-specific relationship to
-
MDL-58018 Reduce session lock contention with opt-in READ_ONLY_SESSION
- Closed