Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb7f31e

Browse files
kjoemichael-grunder
authored andcommitted
Fix random connection timeouts with Redis Cluster
When a node timeout occurs, then phpredis will try to connect to anothernode, whose answer probably will be MOVED redirect. After this we needmore time to accomplish the redirection, otherwise we get "Timed outattempting to find data in the correct node" error message.Fixes#795#888#1142#1385#1633#1707#1811#2407
1 parent8323ddf commiteb7f31e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎cluster_library.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ PHP_REDIS_API redisCluster *cluster_create(double timeout, double read_timeout,
833833
c->err=NULL;
834834

835835
/* Set up our waitms based on timeout */
836-
c->waitms= (long)(1000*timeout);
836+
c->waitms= (long)(1000*(timeout+read_timeout));
837837

838838
/* Allocate our seeds hash table */
839839
ALLOC_HASHTABLE(c->seeds);

‎redis_cluster.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static void redis_cluster_init(redisCluster *c, HashTable *ht_seeds, double time
139139
c->flags->timeout=timeout;
140140
c->flags->read_timeout=read_timeout;
141141
c->flags->persistent=persistent;
142-
c->waitms=timeout*1000L;
142+
c->waitms=(long)(1000*(timeout+read_timeout));
143143

144144
/* Attempt to load slots from cache if caching is enabled */
145145
if (CLUSTER_CACHING_ENABLED()) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp