Closed jishi closed 2 years ago
Your namePrefix
is getting included when defining mutex keys, but yii\redis\Mutex
is running the whole thing through md5()
, so it’s getting obfuscated. Two separate installs should still be getting two separate keys though, so long as each has a unique namePrefix
.
Alternatively, yii\redis\Mutex
has its own keyPrefix
property, which will get included before the md5()
-d key, so if you use that instead, it will be much more obvious that each install is getting its own set of mutex locks.
'mutex' => [
'mutex' => [
'class' => 'yii\redis\Mutex',
'keyPrefix' => 'mutex_',
],
],
What happened?
Description
I have configured redis as mutex store and verified that I indeed get mutex keys momentarily. However, I re-use my redis cluster for multiple installs, and want to separate installs via database, and each database should use prefixes for keys to separate different type of data (sessions and mutex locks)
Steps to reproduce
Expected behavior
Keys for mutex locks should be prefixed
Actual behavior
Keys are not prefixed, they only consists of some guid/uuid
Craft CMS version
4.2.8
PHP version
8.0.22
Operating system and version
Linux 5.10.124-linuxkit
Database type and version
Redis (latest ElastiCache in AWS)
Image driver and version
No response
Installed plugins and versions