Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpFoundation] Allow RedisCluster class for RedisSessionHandler#28251
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
[HttpFoundation] Allow RedisCluster class for RedisSessionHandler#28251
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ec7d4aa to0ed7dbdCompare
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.
Thanks
| !$redisinstanceof \RedisArray && | ||
| !$redisinstanceof \RedisCluster && | ||
| !$redisinstanceof \Predis\Client && | ||
| !$redisinstanceof RedisProxy |
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.
Missing\, same in the docblock
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.
Do you talk about the RedisProxy class? That one is imported at the top of the class.
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.
Right sorry!
| if ( | ||
| !$redisinstanceof \Redis && | ||
| !$redisinstanceof \RedisArray && | ||
| !$redisinstanceof \RedisCluster && |
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.
@nicolas-grekas Just to make things easier to see, this is the condition I added
| !$redisinstanceof \RedisArray && | ||
| !$redisinstanceof \RedisCluster && | ||
| !$redisinstanceof \Predis\Client && | ||
| !$redisinstanceof RedisProxy |
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.
Right sorry!
This PR was merged into the 3.4 branch.Discussion----------[travis] enable Redis cluster| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Will allow testing#28251 alsoCommits-------f245df4 [travis] enable Redis cluster
nicolas-grekas commentedAug 24, 2018
@michaelperrin I added a Redis cluster in#28255. Can you please rebase and add a test case by taking inspiration from this PR? |
d10fa94 to08e92bfComparemichaelperrin commentedAug 24, 2018
Thank you very much@nicolas-grekas, that is indeed useful to have a Redis cluster for tests. I updated tests in order to use it for tests using I didn't get why an extra To make everything work, I removed the validator in tests and used instead the Maybe you or@dkarlovi will know purpose of the Could you make sure that my changes are alright then? If everything looks fine, I will squash commits into one. |
dkarlovi commentedAug 24, 2018
Validator is supposed to be used to connect to the test version of Redis and confirm the intended action happened regardless of the adapter used. Probably shouldn't be changed, but you be the judge, I'm on mobile. |
stof commentedAug 24, 2018
@dkarlovi but shouldn't this |
michaelperrin commentedAug 24, 2018
Thanks@dkarlovi for your insight :) I better understand now why you added this other instance. If we decide it is better to keep the "validator" instance, I will override the other methods in the new |
dkarlovi commentedAug 24, 2018
The idea is to have a stand-alone instance which independently confirms the intended action happened. Otherwise the adapter is testing itself and we're supposed to trust it implicitly. |
nicolas-grekas commentedAug 24, 2018
I agree with this statement, so I'm fine with a single Redis connection personally. |
08e92bf tod2ecea0Comparenicolas-grekas commentedAug 26, 2018
Thank you@michaelperrin. |
…Handler (michaelperrin)This PR was squashed before being merged into the 4.1 branch (closes#28251).Discussion----------[HttpFoundation] Allow RedisCluster class for RedisSessionHandler| Q | A| ------------- | ---| Branch? | 4.1 <!-- see below -->| Bug fix? | yes| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR |The `RedisSessionHandler` added in Symfony 4.1 was supposed to accept `RedisCluster` instances but that possibility was not in the condition, leading to an `InvalidArgumentException`.I formatted the object type condition to allow the `RedisCluster` instance value and also added a test for it.A double space formatting issue has been fixed too (which is included in the same commit, I can change that if needed).I could not add a test using RedisCluster, as the installed Redis instance on Travis doesn't use clusters.Commits-------d2ecea0 [HttpFoundation] Allow RedisCluster class for RedisSessionHandler
michaelperrin commentedAug 27, 2018
Thanks@nicolas-grekas for the merge and the help! |
dkarlovi commentedAug 27, 2018
Nice work@michaelperrin! 👍 |
michaelperrin commentedAug 27, 2018
@dkarlovi It is based on your work, so thanks to you ;) |
The
RedisSessionHandleradded in Symfony 4.1 was supposed to acceptRedisClusterinstances but that possibility was not in the condition, leading to anInvalidArgumentException.I formatted the object type condition to allow the
RedisClusterinstance value and also added a test for it.A double space formatting issue has been fixed too (which is included in the same commit, I can change that if needed).
I could not add a test using RedisCluster, as the installed Redis instance on Travis doesn't use clusters.