corrected - if (attached.isServer && attached.isHandShakingComplete())

This commit is contained in:
Rob Austin
2015-10-02 02:53:10 +03:00
committed by leventov
parent 7bbaa9e402
commit c2e634fa13
@@ -388,29 +388,29 @@ public final class TcpReplicator<K, V> extends AbstractChannelReplicator impleme
final Attached attached = (Attached) key.attachment();
if (attached.isServer && attached.isHandShakingComplete()) {
if (attached.isServer && !attached.isHandShakingComplete())
return;
final SocketChannel channel = (SocketChannel) key.channel();
final SocketChannel channel = (SocketChannel) key.channel();
if (approxTimeOutTime >
attached.entryReader.lastHeartBeatReceived + attached.remoteHeartbeatInterval) {
if (LOG.isDebugEnabled())
LOG.debug("lost connection, attempting to reconnect. " +
"missed heartbeat from identifier=" + attached.remoteIdentifier);
activeKeys.clear(attached.remoteIdentifier);
quietClose(key, null);
if (approxTimeOutTime >
attached.entryReader.lastHeartBeatReceived + attached.remoteHeartbeatInterval) {
if (LOG.isDebugEnabled())
LOG.debug("lost connection, attempting to reconnect. " +
"missed heartbeat from identifier=" + attached.remoteIdentifier);
activeKeys.clear(attached.remoteIdentifier);
quietClose(key, null);
closeables.closeQuietly(channel.socket());
closeables.closeQuietly(channel.socket());
// when node discovery is used ( by nodes broadcasting out their host:port over UDP ),
// when new or restarted nodes are started up. they attempt to find the nodes
// on the grid by listening to the host and ports of the other nodes, so these nodes
// will establish the connection when they come back up, hence under these
// circumstances, polling a dropped node to attempt to reconnect is no-longer
// required as the remote node will establish the connection its self on startup.
if (replicationConfig.autoReconnectedUponDroppedConnection())
attached.connector.connectLater();
}
// when node discovery is used ( by nodes broadcasting out their host:port over UDP ),
// when new or restarted nodes are started up. they attempt to find the nodes
// on the grid by listening to the host and ports of the other nodes, so these nodes
// will establish the connection when they come back up, hence under these
// circumstances, polling a dropped node to attempt to reconnect is no-longer
// required as the remote node will establish the connection its self on startup.
if (replicationConfig.autoReconnectedUponDroppedConnection())
attached.connector.connectLater();
}
}