-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Fix Predis client cluster with pipeline #23237
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
Conversation
flolivaud
commented
Jun 20, 2017
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 3.3 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | n/a |
License | MIT |
Doc PR | n/a |
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.
👍 with minor comments
@@ -284,7 +285,7 @@ private function pipeline(\Closure $generator) | |||
{ | |||
$ids = array(); | |||
|
|||
if ($this->redis instanceof \Predis\Client) { | |||
if ($this->redis instanceof \Predis\Client && !($this->redis->getConnection() instanceof ClusterInterface)) { |
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.
No need for the parentheses.
} elseif ($this->redis instanceof \RedisCluster) { | ||
// phpredis doesn't support pipelining with RedisCluster | ||
} elseif ($this->redis instanceof \RedisCluster || ( | ||
$this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface |
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.
Should be on one line.
802f95f
to
1608ba6
Compare
@flolivaud Can you change the base to the lowest possible version? |
@fabpot Done |
when lowering the branch on gh interface, one needs to rebase the branch as well, as if not, he ends up with all commits from original base branch in his PR |
1608ba6
to
235dfe8
Compare
all bugfixes deserve a test. please add one |
Note that in this case, having a test might be complicated... |
235dfe8
to
e82720e
Compare
Yes it is. I try to fix the test to connect in cluster mode but i don't know how to do more. |
69c12cc
to
81a9efc
Compare
} elseif ($this->redis instanceof \RedisCluster) { | ||
// phpredis doesn't support pipelining with RedisCluster | ||
} elseif ($this->redis instanceof \RedisCluster || ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface)) { | ||
// phpredis & predis doesn't support pipelining with 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.
s/doesn't/don't
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.
Sorry. Done. :)
81a9efc
to
a85d5b0
Compare
Thank you @flolivaud. |
This PR was merged into the 3.3 branch. Discussion ---------- [Cache] Fix Predis client cluster with pipeline | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- a85d5b0 Fix Predis client cluster with pipeline
@fabpot the fix is actually on the 3.3 branch, but need to be on 3.3+ branches (master included). |
@flolivaud branches are merged up regularly so each fix will eventually land in all still maintained branches |