xxl-job調度執行器的端口被外部頻繁訪問造成的錯誤如下:
[2020-05-16 16:52:54.996][ERROR][][nioEventLoopGroup-5-5][c.x.j.c.server.EmbedServer$EmbedHttpServerHandler] - >>>>>>>>>>> xxl-job provider netty_http server caught exception
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:380)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:548)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:502)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
雖然該錯誤提示並不影響定時任務的調度執行.但是這個日誌是端口每被外部訪問一次就會報一次錯誤.會打印很多很多日誌.
最後在xxl-job的github問題中發現徐雪力老師回答到該錯誤是因爲執行器設置的端口也就是9999可能被爬蟲或者外部項目頻繁訪問造成的錯誤.
然後想到我們項目是設置了阿里雲的負載均衡的健康檢查的.針對9999端口做了檢查.每隔兩秒中就會檢查訪問一次.
這是個坑....去掉負載均衡的健康檢查就沒有事兒了