From 3f24013cd84e2e1f200d03576b06cdf77dc851b2 Mon Sep 17 00:00:00 2001 From: leon Date: Tue, 22 Nov 2016 22:41:27 +0800 Subject: [PATCH] 1.0.15-release fix socket close bug --- .../moilioncircle/redis/replicator/RedisSocketReplicator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/moilioncircle/redis/replicator/RedisSocketReplicator.java b/src/main/java/com/moilioncircle/redis/replicator/RedisSocketReplicator.java index 4dbfebc7..b74eebbc 100644 --- a/src/main/java/com/moilioncircle/redis/replicator/RedisSocketReplicator.java +++ b/src/main/java/com/moilioncircle/redis/replicator/RedisSocketReplicator.java @@ -90,7 +90,8 @@ public void open() throws IOException { final String reply = (String) reply(); SyncMode syncMode = trySync(reply); - if (syncMode == SyncMode.PSYNC) { + //bug fix. + if (syncMode == SyncMode.PSYNC && connected.get()) { //heart beat send REPLCONF ACK ${slave offset} heartBeat = new Timer("heart beat");