Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy 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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedFeb 2, 2022
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution 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 |
alebedev80 commentedFeb 2, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@kbond I did a first PR to Symfony project and had some issues:
|
kbond commentedFeb 2, 2022
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. |
alebedev80 commentedFeb 3, 2022
@kbond test failed with an error: as i understand test envirionment start a Redis instance
Thank you! |
kbond commentedFeb 3, 2022
I'll have to ping@nicolas-grekas to help with this. |
alebedev80 commentedFeb 4, 2022
@nicolas-grekas please help |
nicolas-grekas left a comment
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.
nicolas-grekas commentedFeb 4, 2022
Thank you@alebedev80. |
alebedev80 commentedFeb 4, 2022
@nicolas-grekas thank you very much! |
Uh oh!
There was an error while loading.Please reload this page.
In thecommit 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.