Wir verwenden haproxy, um Last zu balancieren, und die netty Server weiter zu steigen "java.io.IOException: Verbindung zurückgesetzt von Peer" unten ist die Ausnahme-Stack:netty java.io.IOException: Verbindung zurückgesetzt durch Peer verursacht durch RST, ACK
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1055)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:245)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:112)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:510)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:467)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:381)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
ich tcpdump verwenden, um die Netzwerkdaten des netty Server-Dump, und siehe unten
10.125.137.11,10.125.137.13,10.125.137.14 sind hapxory server ip Scheint haproxy Senden Sie einfach [RST, ACK], um einen Gesundheitscheck zu beenden.
Also frage ich mich, ob ich diese Situation in meinem Handler behandeln muss (wie check Ausnahme ist IOException, einfach ignorieren, weil das Protokoll voll von dieser Ausnahme ist), oder es sollte von Netty es selbst behandelt werden?
Ich habe darüber nachgedacht, aber ich machte mir Sorgen, wenn ich nur die IOException ignorieren, vielleicht wird der gleiche echte Fehler auch ignoriert –