Merge pull request #1724 from antimony/ipv6-host-port-parse-fix

Fix host-port splitter in SentinelConnectionManager for ipv6 addresses
pull/1730/head
Nikita Koksharov 6 years ago committed by GitHub
commit 9b30cf0088
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -371,8 +371,11 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager {
Set<String> removedSlaves = new HashSet<String>(slaves);
removedSlaves.removeAll(currentSlaves);
for (String slave : removedSlaves) {
String[] parts = slave.replace("redis://", "").split(":");
slaveDown(parts[0], parts[1]);
String hostPort = slave.replace("redis://", "");
int lastColonIdx = hostPort.lastIndexOf(":");
String host = hostPort.substring(0, lastColonIdx);
String port = hostPort.substring(lastColonIdx + 1);
slaveDown(host, port);
}
};
};

Loading…
Cancel
Save