From c3f8e8f2a3fbc65800becac2fa9505822c5669a8 Mon Sep 17 00:00:00 2001 From: Aram Peres <6775216+aramperes@users.noreply.github.com> Date: Sun, 19 Jan 2025 17:58:15 -0500 Subject: [PATCH] fix: resolve Sentinel master change through NAT Signed-off-by: Aram Peres <6775216+aramperes@users.noreply.github.com> --- .../org/redisson/connection/SentinelConnectionManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redisson/src/main/java/org/redisson/connection/SentinelConnectionManager.java b/redisson/src/main/java/org/redisson/connection/SentinelConnectionManager.java index 77df18d5d..54a1fe4da 100755 --- a/redisson/src/main/java/org/redisson/connection/SentinelConnectionManager.java +++ b/redisson/src/main/java/org/redisson/connection/SentinelConnectionManager.java @@ -508,7 +508,8 @@ public class SentinelConnectionManager extends MasterSlaveConnectionManager { RFuture masterFuture = connection.async(1, cfg.getRetryInterval(), cfg.getTimeout(), StringCodec.INSTANCE, masterHostCommand, cfg.getMasterName()); return masterFuture - .thenCompose(u -> serviceManager.resolveIP(scheme, u)) + .thenCompose(u -> resolveIP(u.getHost(), "" + u.getPort())) + .thenApply(this::toURI) .thenCompose(newMaster -> { RedisURI current = currentMaster.get(); if (!newMaster.equals(current)