MDL-78092 Cache: Modinfo locking with Redis store does not work
commit2724eb6041f1d48e720d31684074586b15188ab6
authorsam marshall <s.marshall@open.ac.uk>
Wed, 3 May 2023 09:47:01 +0000 (3 10:47 +0100)
committersam marshall <s.marshall@open.ac.uk>
Mon, 22 May 2023 09:44:15 +0000 (22 10:44 +0100)
tree9370b606a8780076ed74850dc398b83a3c52732d
parent4781b41631664d3c5e7e94cfcc279b2af81e4dd1
MDL-78092 Cache: Modinfo locking with Redis store does not work

The feature added in 4.1 to lock the modinfo cache does not work when
using Redis, because:

* The API to acquire a cache lock is confusing, and the code did not
  check that it successfully acquired a lock before going on to build
  the cache anyway.

* Unlike the other types of cache lock, the Redis store did not retry
  the lock for a timeout period before giving up and failing.

This change fixes both points.
cache/stores/redis/lib.php
cache/stores/redis/tests/store_test.php
lib/modinfolib.php