-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Lock] "Cannot use 'SCRIPT' with redis-cluster" after updating to symfony/lock 7.2.* when using a redis cluster with RedisStore #59795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you work on a fix maybe? That might be the most effective way to solve this ;) |
Can't promise anything, but I could definitely try 😅 I'll report back if I face any blocker or have questions. |
Ok so, by my debugging, I think the issue was introduced by the changes in #58533 In there, instead of evaluating a script every time, the logic loads that script in redis and evaluates it via its hash in subsequent attempts, to reduce network I/O. That's nice, but doesn't seem to work with redis clusters, at least when using predis, although that same PR tries to load the script in the master instance when using One possible solution I see is checking if the predis connection is an aggregate one, and use the former approach in which the same script was evaluated every time. When testing that locally, it seems to work. On top of that, there's two supported predis versions that need to be tested, and different ways to clusterize redis (master/slave, sentinels, etc). I'll try to test all possible scenarios and see if there's in fact a way to take advantage of loaded scripts. |
Symfony version(s) affected
7.2.*
Description
When trying to acquire a lock with symfony lock using a
RedisStore
withpredis
and a redis cluster, the errorCannot use 'SCRIPT' with redis-cluster
is thrown.Everything works as expected on
symfony/lock
7.1.6, so I guess the issue is somewhere here symfony/lock@v7.1.6...v7.2.0On
symfony/lock
7.2.3, a different error is thrown though, which was already reported in #59686, and solved via a PR.I tested with the changes introduced in that PR, and the error goes back to what I'm reporting here.
How to reproduce
Create a folder with the following files:
docker-compose.yml
composer.json
index.php
Then run the following commands:
docker compose up -d
composer install
php index.php
You will see the following error:
If you update the
composer.json
like thisThen run
composer update
and thenphp index.php
, you'll experience no such error.Possible Solution
No response
Additional Context
The text was updated successfully, but these errors were encountered: