HCOLL-231 Close the connection when the attached is dropped.

This commit is contained in:
Peter Lawrey
2014-12-10 10:44:48 +00:00
parent 2dc8b49239
commit e14461249d
@@ -592,7 +592,11 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
final long approxTime) throws IOException {
final SocketChannel socketChannel = (SocketChannel) key.channel();
final Attached attached = (Attached) key.attachment();
if (attached == null) throw new NullPointerException("No attached");
if (attached == null) {
LOG.info("Closing connection " + socketChannel + ", nothing attached");
socketChannel.close();
return;
}
TcpSocketChannelEntryWriter entryWriter = attached.entryWriter;
if (entryWriter == null) throw new NullPointerException("No entryWriter");
if (entryWriter.isWorkIncomplete()) {