Skip to content

Commit

Permalink
Fixed - retryAttempts and retryInterval settings don't apply to INFO_…
Browse files Browse the repository at this point in the history
…REPLICATION, SENTINEL_GET_MASTER_ADDR_BY_NAME, SENTINEL_SENTINELS, SENTINEL_SLAVES and CLUSTER_NODES commands. #4884, #5973, #5696
  • Loading branch information
Nikita Koksharov committed Aug 22, 2024
1 parent 4448bc3 commit 09bde0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private CompletableFuture<Role> checkNode(RedisURI uri, ReplicatedServersConfig
return CompletableFuture.<Map<String, String>>completedFuture(null);
}

return connection.async(3, cfg.getRetryInterval(), cfg.getTimeout(),
return connection.async(1, cfg.getRetryInterval(), cfg.getTimeout(),
StringCodec.INSTANCE, RedisCommands.INFO_REPLICATION);
})
.thenCompose(r -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ private CompletionStage<Void> checkSentinelsChange(SentinelServersConfig cfg, Re
return CompletableFuture.completedFuture(null);
}

RFuture<List<Map<String, String>>> sentinelsFuture = connection.async(3, cfg.getRetryInterval(), cfg.getTimeout(),
RFuture<List<Map<String, String>>> sentinelsFuture = connection.async(1, cfg.getRetryInterval(), cfg.getTimeout(),
StringCodec.INSTANCE, RedisCommands.SENTINEL_SENTINELS, cfg.getMasterName());
return sentinelsFuture.thenCompose(list -> {
if (list.isEmpty()) {
Expand Down Expand Up @@ -437,7 +437,7 @@ private CompletionStage<Void> checkSentinelsChange(SentinelServersConfig cfg, Re
}

private CompletionStage<Void> checkSlavesChange(SentinelServersConfig cfg, RedisConnection connection) {
RFuture<List<Map<String, String>>> slavesFuture = connection.async(3, cfg.getRetryInterval(), cfg.getTimeout(),
RFuture<List<Map<String, String>>> slavesFuture = connection.async(1, cfg.getRetryInterval(), cfg.getTimeout(),
StringCodec.INSTANCE, RedisCommands.SENTINEL_SLAVES, cfg.getMasterName());
return slavesFuture.thenCompose(slavesMap -> {
Set<RedisURI> currentSlaves = Collections.newSetFromMap(new ConcurrentHashMap<>(slavesMap.size()));
Expand Down Expand Up @@ -506,7 +506,7 @@ private CompletionStage<Void> checkSlavesChange(SentinelServersConfig cfg, Redis
}

private CompletionStage<RedisClient> checkMasterChange(SentinelServersConfig cfg, RedisConnection connection) {
RFuture<RedisURI> masterFuture = connection.async(3, cfg.getRetryInterval(), cfg.getTimeout(),
RFuture<RedisURI> masterFuture = connection.async(1, cfg.getRetryInterval(), cfg.getTimeout(),
StringCodec.INSTANCE, masterHostCommand, cfg.getMasterName());
return masterFuture
.thenCompose(u -> serviceManager.resolveIP(scheme, u))
Expand Down

0 comments on commit 09bde0f

Please sign in to comment.