Skip to content

Instantly share code, notes, and snippets.

@ishiis
Last active October 3, 2016 11:01
Show Gist options
  • Save ishiis/82e19c8d97b65c1fa625816b173cb1f7 to your computer and use it in GitHub Desktop.
Save ishiis/82e19c8d97b65c1fa625816b173cb1f7 to your computer and use it in GitHub Desktop.

vertx(3.3.3) + netty(4.1.1) + Keepalive(health check) => IOException

2016-09-06 22:05:07.791  WARN 28370 --- [ntloop-thread-0] io.netty.channel.DefaultChannelPipeline  : An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.

java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_101]
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.8.0_101]
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_101]
        at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.8.0_101]
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_101]
        at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288) ~[netty-buffer-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1098) ~[netty-buffer-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[netty-transport-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:112) ~[netty-transport-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:563) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:504) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:418) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:390) [netty-transport-4.1.1.Final.jar:4.1.1.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742) [netty-common-4.1.1.Final.jar:4.1.1.Final]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]

https://github.com/netty/netty/blob/netty-4.1.1.Final/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java https://github.com/netty/netty/blob/netty-4.1.1.Final/common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.java#L742

L741:  try {
L742:      SingleThreadEventExecutor.this.run();
L743:      success = true;
L744:  } catch (Throwable t) {
L745:      logger.warn("Unexpected exception from an event executor: ", t);
L746:+ } catch (IOException ioe) {
L747:+     logger.info("Connection reset by Keepalived: ", ioe);
L746:  } finally {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment