-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Cache] Issue with RedisTrait::createConnection miss processing redis_cluster value #50509
Comments
Would you mind sending a pull request with what you have in mind? |
Hello, After upgrading to Symfony 6.3 i have issue with the container, redis and the
In
$factory:
$arguments:
It does not seems to correctly determine the Redis adapter. Hope it helps. |
We just got bit by this: we had some downtime because the application could not connect to our Redis cluster. Although it's a good opportunity for us to start thinking about smoke tests again, I wonder why Symfony 6.3 was shipped knowing about this bug. I understand that you cannot delay such a release because of some bug report, but maybe the change in this class could have been reverted before the 6.3 release? I'm curious about the process here, and if this is something to review. To be clear: I fully understand these things can happen, but it decreases the trust with upgrading a minor release a bit. |
@pkruithof this bug was reported after the release |
Ah crap, I should've checked that, I was thinking it was released about 3/4 days ago. Sorry about that. |
When the dsn contains `redis_cluster=1` or `redis_cluster=true` the value was not properly parsed, and the class generated wan not the expected RedisCluster
PR opened :) |
…anakin41) This PR was submitted for the 6.3 branch but it was squashed and merged into the 5.4 branch instead. Discussion ---------- [Cache] Fix RedisTrait::createConnection for cluster | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | No | Deprecations? | No | Tickets | Fix #50509 | License | MIT | Doc PR | N/A When the dsn contains `redis_cluster=1` or `redis_cluster=true` the value was not properly parsed, and the class generated was not the expected RedisCluster. The reason is that the PHP core function `match` make a `===` check. So, as the dsn is a string, the `$params['redis_cluster']` needs to be force to a bool Commits ------- ca8e328 [Cache] Fix RedisTrait::createConnection for cluster
Symfony version(s) affected
6.3.0
Description
When trying to initialize a redis cluster connection through symfony/cache RedisAdapter::createConnection, the method returns a RedisArray instead of a RedisCluster
With this issue, i have to manually set the class in the DSN to \RedisCluster in order for it to work.
How to reproduce
Simply pass one of the following strings as DSN to the method :
You will get a RedisArray class.
Possible Solution
In the RedisTrait class, starting from line 180 :
Additional Context
No response
The text was updated successfully, but these errors were encountered: