Skip to content

Commit 2d06c45

Browse files
adiamznEC2 Default Usersazzad16
committed
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 33130b4 commit 2d06c45

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
@@ -144,12 +144,10 @@ public JedisClusterInfoCache(final GenericObjectPoolConfig<Jedis> poolConfig,
144144
}
145145

146146
public void discoverClusterNodesAndSlots(Jedis jedis) {
147+
List<Object> slots = jedis.clusterSlots();
147148
w.lock();
148-
149149
try {
150150
reset();
151-
List<Object> slots = jedis.clusterSlots();
152-
153151
for (Object slotInfoObj : slots) {
154152
List<Object> slotInfo = (List<Object>) slotInfoObj;
155153

0 commit comments

Comments
 (0)