8000 bug #22924 [Cache] Dont use pipelining with RedisCluster (nicolas-gre… · symfony/symfony@88cdd3c · GitHub
[go: up one dir, main page]

Skip to content

Commit 88cdd3c

Browse files
bug #22924 [Cache] Dont use pipelining with RedisCluster (nicolas-grekas)
This PR was merged into the 3.2 branch. Discussion ---------- [Cache] Dont use pipelining with RedisCluster | Q | A | ------------- | --- | Branch? | 3.é | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22922 | License | MIT | Doc PR | - phpredis doesn't support pipelining with RedisCluster see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining and multiple operations (MSET/MGET) work but only "per-shard". We have to fetch keys one by one for now at least. Commits ------- eb93ac9 [Cache] Dont use pipelining with RedisCluster
2 parents e37455f + eb93ac9 commit 88cdd3c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Symfony/Component/Cache/Adapter/RedisAdapter.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ private function pipeline(\Closure $generator)
303303
foreach ($results as $k => list($h, $c)) {
304304
$results[$k] = $connections[$h][$c];
305305
}
306+
} elseif ($this->redis instanceof \RedisCluster) {
307+
// phpredis doesn't support pipelining with RedisCluster
308+
// see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining
309+
$result = array();
310+
foreach ($generator() as $command => $args) {
311+
$ids[] = $args[0];
312+
$result[] = call_user_func_array(array($this->redis, $command), $args);
313+
}
306314
} else {
307315
$this->redis->multi(\Redis::PIPELINE);
308316
foreach ($generator() as $command => $args) {

0 commit comments

Comments
 (0)
0