Skip to content

Commit b82967a

Browse files
adiamznEC2 Default Usersazzad16
authored
Fixes bug in JedisClusterInfoCache.discoverClusterNodesAndSlots. (#2682)
Calls jedis.Clusterslots before calling reset, instead of the other way around. Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Co-authored-by: EC2 Default User <ec2-user@ip-172-31-47-142.us-west-2.compute.internal> Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
1 parent 253664f commit b82967a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/redis/clients/jedis/JedisClusterInfoCache.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,10 @@ public JedisClusterInfoCache(final GenericObjectPoolConfig<Jedis> poolConfig,
104104
}
105105

106106
public void discoverClusterNodesAndSlots(Jedis jedis) {
107+
List<Object> slots = jedis.clusterSlots();
107108
w.lock();
108-
109109
try {
110110
reset();
111-
List<Object> slots = jedis.clusterSlots();
112-
113111
for (Object slotInfoObj : slots) {
114112
List<Object> slotInfo = (List<Object>) slotInfoObj;
115113

0 commit comments

Comments
 (0)