Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Jun 21, 2017

Conversation

flolivaud
Copy link
Contributor

@flolivaud flolivaud commented Jun 20, 2017

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

Copy link
Member

@nicolas-grekas nicolas-grekas left a 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)) {
Copy link
Member

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
Copy link
Member

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.

@flolivaud flolivaud force-pushed the fix/predisCluster branch from 802f95f to 1608ba6 Compare June 20, 2017 15:35
@fabpot
Copy link
Member

fabpot commented Jun 20, 2017

@flolivaud Can you change the base to the lowest possible version?

@flolivaud
Copy link
Contributor Author

flolivaud commented Jun 20, 2017

@fabpot Done

@flolivaud flolivaud changed the title Fix Predis client cluster with pipeline [Cache] Fix Predis client cluster with pipeline Jun 20, 2017
@flolivaud flolivaud changed the base branch from master to 3.2 June 20, 2017 19:15
@keradus
Copy link
Member

keradus commented Jun 21, 2017

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

@flolivaud flolivaud changed the base branch from 3.2 to 3.3 June 21, 2017 06:50
@flolivaud flolivaud force-pushed the fix/predisCluster branch from 1608ba6 to 235dfe8 Compare June 21, 2017 06:51
@flolivaud flolivaud changed the base branch from 3.3 to master June 21, 2017 06:52
@flolivaud flolivaud changed the base branch from master to 3.3 June 21, 2017 06:53
@flolivaud
Copy link
Contributor Author

@keradus yes sorry, seems to be good ! /cc @fabpot

@keradus
Copy link
Member

keradus commented Jun 21, 2017

all bugfixes deserve a test. please add one

@nicolas-grekas
Copy link
Member

Note that in this case, having a test might be complicated...

@flolivaud flolivaud force-pushed the fix/predisCluster branch from 235dfe8 to e82720e Compare June 21, 2017 08:41
@flolivaud
Copy link
Contributor Author

flolivaud commented Jun 21, 2017

Yes it is. I try to fix the test to connect in cluster mode but i don't know how to do more.

@flolivaud flolivaud force-pushed the fix/predisCluster branch 3 times, most recently from 69c12cc to 81a9efc Compare June 21, 2017 09:28
} 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
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Done. :)

@flolivaud flolivaud force-pushed the fix/predisCluster branch from 81a9efc to a85d5b0 Compare June 21, 2017 09:33
@fabpot
Copy link
Member

fabpot commented Jun 21, 2017

Thank you @flolivaud.

@fabpot fabpot merged commit a85d5b0 into symfony:3.3 Jun 21, 2017
fabpot added a commit that referenced this pull request Jun 21, 2017
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
@flolivaud flolivaud deleted the fix/predisCluster branch June 21, 2017 14:37
@flolivaud
Copy link
Contributor Author

@fabpot the fix is actually on the 3.3 branch, but need to be on 3.3+ branches (master included).

@xabbuh
Copy link
Member

xabbuh commented Jun 22, 2017

@flolivaud branches are merged up regularly so each fix will eventually land in all still maintained branches

@fabpot fabpot mentioned this pull request Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants