Fixed - Repeated new connections with AWS Elasticache serverless #5589

pull/5599/head
Nikita Koksharov 1 year ago
parent e216e64829
commit b4c9bd502e

@ -847,7 +847,7 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
CompletableFuture<List<RedisURI>> ipsFuture = serviceManager.resolveAll(clusterNodeInfo.getAddress());
CompletableFuture<Void> f = ipsFuture.thenAccept(addresses -> {
if (addresses.size() > 1 && clusterNodeInfo.containsFlag(Flag.MASTER)) {
addresses.sort(null);
addresses.sort(Comparator.comparing(RedisURI::getHost));
Collections.shuffle(addresses, new Random(serviceManager.getId().hashCode()));
}
RedisURI address = addresses.get(0);

Loading…
Cancel
Save