Skip to content

Commit

Permalink
Fix #2559: maxTotalRetriesDuration = soTimeout * maxAttempts (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Jun 7, 2021
1 parent ae04b51 commit bb52836
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/redis/clients/jedis/BinaryJedisCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeo
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, user, password, clientName);
this.maxAttempts = maxAttempts;
this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout);
this.maxTotalRetriesDuration = Duration.ofMillis((long) soTimeout * maxAttempts);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout,
Expand All @@ -90,7 +90,7 @@ public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeo
this.connectionHandler = new JedisSlotBasedConnectionHandler(jedisClusterNode, poolConfig,
connectionTimeout, soTimeout, infiniteSoTimeout, user, password, clientName);
this.maxAttempts = maxAttempts;
this.maxTotalRetriesDuration = Duration.ofMillis(soTimeout);
this.maxTotalRetriesDuration = Duration.ofMillis((long) soTimeout * maxAttempts);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout,
Expand Down Expand Up @@ -169,7 +169,7 @@ public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeo
public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, JedisClientConfig clientConfig,
int maxAttempts, GenericObjectPoolConfig<Jedis> poolConfig) {
this(jedisClusterNode, clientConfig, maxAttempts,
Duration.ofMillis((long) DEFAULT_TIMEOUT * maxAttempts), poolConfig);
Duration.ofMillis((long) clientConfig.getSocketTimeoutMillis() * maxAttempts), poolConfig);
}

public BinaryJedisCluster(Set<HostAndPort> jedisClusterNode, JedisClientConfig clientConfig,
Expand Down

0 comments on commit bb52836

Please sign in to comment.