mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-128 cleanup Replicators closeables handling, fixed small defect -- AbstractConnector.connectLater didn't remove channel from closeables
This commit is contained in:
@@ -277,19 +277,13 @@ class TcpReplicator extends AbstractChannelReplicator implements Closeable {
|
||||
|
||||
final SocketChannel channel = (SocketChannel) key.channel();
|
||||
|
||||
if (approxTimeOutTime > attached.entryReader.lastHeartBeatReceived + attached.remoteHeartbeatInterval) {
|
||||
if (approxTimeOutTime >
|
||||
attached.entryReader.lastHeartBeatReceived + attached.remoteHeartbeatInterval) {
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("lost connection, attempting to reconnect. " +
|
||||
"missed heartbeat from identifier=" + attached.remoteIdentifier);
|
||||
try {
|
||||
channel.socket().close();
|
||||
channel.close();
|
||||
activeKeys.clear(attached.remoteIdentifier);
|
||||
closeables.remove(channel);
|
||||
} catch (IOException e) {
|
||||
LOG.debug("", e);
|
||||
}
|
||||
|
||||
activeKeys.clear(attached.remoteIdentifier);
|
||||
closeables.closeQuietly(channel.socket());
|
||||
attached.connector.connectLater();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user