Fixed - dead Sentinel appears in logs as node added and down. #2143

pull/2190/head
Nikita Koksharov 6 years ago
parent 58236688af
commit b357e62a5d

@ -511,9 +511,27 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
return; return;
} }
sentinels.putIfAbsent(addr, client); RFuture<RedisConnection> f = client.connectAsync();
log.info("sentinel: {} added", addr); f.onComplete((connection, ex) -> {
result.trySuccess(null); if (ex != null) {
result.tryFailure(ex);
return;
}
RFuture<String> r = connection.async(config.getTimeout(), RedisCommands.PING);
r.onComplete((resp, exc) -> {
if (exc != null) {
result.tryFailure(exc);
return;
}
if (sentinels.putIfAbsent(addr, client) == null) {
log.info("sentinel: {} added", addr);
}
result.trySuccess(null);
});
});
}); });
return result; return result;
} }

Loading…
Cancel
Save