-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Fix connecting to Redis via a socket file #45281
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] Fix connecting to Redis via a socket file #45281
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
@kbond I did a first PR to Symfony project and had some issues:
|
Hey @alebedev80, thanks for contributing! For (1), a few things:
For (2), I think you'll need to run the test suite with the
I'm not positive though, let me know if that doesn't work. |
@kbond test failed with an error:
as i understand test envirionment start a Redis instance
Thank you! |
I'll have to ping @nicolas-grekas to help with this. |
@nicolas-grekas please help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased for 4.4, fixed the patch, and fixed the tests.
Thank you @alebedev80. |
@nicolas-grekas thank you very much! |
In the commit was done follow changes in Traits/RedisTrait.php(188)
Old code:
$port = $hosts[0]['port'] ?? null;
New code:
$port = $hosts[0]['port'] ?? 6379;
With DSN "redis:///var/run/redis/redis.sock" raise an error:
Because phpredis doesn't allow socket connections with a port
Error
I added additional validation of connection type (by host or socket). Also I fixed condition when RedisSentinel connection call as it supports connections by host only.