HCOLL-133 don't try to close channels thrown exceptions if TCP/UDP replicator already closed

This commit is contained in:
leventov
2014-09-19 13:40:20 +04:00
parent e3a16746a5
commit 1c1724b189
2 changed files with 12 additions and 6 deletions
@@ -148,16 +148,21 @@ class TcpReplicator extends AbstractChannelReplicator implements Closeable {
onWrite(key, approxTime);
} catch (CancelledKeyException e) {
quietClose(key, e);
if (!isClosed)
quietClose(key, e);
} catch (ClosedSelectorException e) {
quietClose(key, e);
if (!isClosed)
quietClose(key, e);
} catch (IOException e) {
quietClose(key, e);
if (!isClosed)
quietClose(key, e);
} catch (InterruptedException e) {
quietClose(key, e);
if (!isClosed)
quietClose(key, e);
} catch (Exception e) {
LOG.info("", e);
closeEarlyAndQuietly(key.channel());
if (!isClosed)
closeEarlyAndQuietly(key.channel());
}
}
selectionKeys.clear();