ignore cancelled key exception as well

This commit is contained in:
Shay Banon 2012-08-23 23:35:48 +02:00
parent 072fcaa760
commit 333293babd
1 changed files with 4 additions and 3 deletions

View File

@ -57,6 +57,7 @@ import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.nio.channels.CancelledKeyException;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
@ -471,12 +472,12 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
disconnectFromNode(entry.getKey()); disconnectFromNode(entry.getKey());
} }
} }
} else if (isConnectException(e.getCause())) { } else if (isConnectException(e.getCause()) || e.getCause() instanceof CancelledKeyException) {
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
logger.trace("(Ignoring) Exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause()); logger.trace("(Ignoring) exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause());
} }
} else { } else {
logger.warn("Exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause()); logger.warn("exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause());
} }
} }