From bc2aaf0854ee23d90237dd1335dc862f3fa78332 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Thu, 14 Jan 2016 15:22:50 +0000 Subject: [PATCH] possible fix to race codition reported by Ozan --- src/main/java/net/openhft/chronicle/map/TcpReplicator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java index 16784ec09..ce442529a 100644 --- a/src/main/java/net/openhft/chronicle/map/TcpReplicator.java +++ b/src/main/java/net/openhft/chronicle/map/TcpReplicator.java @@ -650,12 +650,11 @@ final class TcpReplicator extends AbstractChannelReplicator implements Clo LOG.debug("handshaking for localIdentifier=" + localIdentifier + "," + "remoteIdentifier=" + remoteIdentifier); + long timeStampOfLastMessage = replica.lastModificationTime(remoteIdentifier); attached.remoteModificationIterator = replica.acquireModificationIterator(remoteIdentifier); attached.remoteModificationIterator.setModificationNotifier(attached); - - long timeStampOfLastMessage = replica.lastModificationTime(remoteIdentifier); writer.writeRemoteBootstrapTimestamp(timeStampOfLastMessage); writer.writeServerVersion(); @@ -756,6 +755,7 @@ final class TcpReplicator extends AbstractChannelReplicator implements Clo entryWriter.entriesToBuffer(attached.remoteModificationIterator); try { + final int len = entryWriter.writeBufferToSocket(socketChannel, approxTime); if (len == -1)