Skip to content

Commit 333293b

Browse files
committed
ignore cancelled key exception as well
1 parent 072fcaa commit 333293b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/org/elasticsearch/transport/netty/NettyTransport.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import java.net.InetAddress;
5858
import java.net.InetSocketAddress;
5959
import java.net.SocketAddress;
60+
import java.nio.channels.CancelledKeyException;
6061
import java.util.*;
6162
import java.util.concurrent.ConcurrentMap;
6263
import java.util.concurrent.CountDownLatch;
@@ -471,12 +472,12 @@ void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Excepti
471472
disconnectFromNode(entry.getKey());
472473
}
473474
}
474-
} else if (isConnectException(e.getCause())) {
475+
} else if (isConnectException(e.getCause()) || e.getCause() instanceof CancelledKeyException) {
475476
if (logger.isTraceEnabled()) {
476-
logger.trace("(Ignoring) Exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause());
477+
logger.trace("(Ignoring) exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause());
477478
}
478479
} else {
479-
logger.warn("Exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause());
480+
logger.warn("exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause());
480481
}
481482
}
482483

0 commit comments

Comments
 (0)