微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

xxl-job使用遇到的问题三

1、问题现象

这两天系统日志里面总会出现xxl-job的报错,但是job执行器能被正常调用并执行,调度日志也都显示成功。

不影响正常使用,但是error报错多了,就容易触发告警。o(╯□╰)o

content: >>>>>>>>>>> xxl-job provider netty_http server caught exception

java.io.IOException: Connection reset by peer

​ at sun.nio.ch.FiledispatcherImpl.read0(Native Method) ~[?:1.8.0_65]

​ at sun.nio.ch.socketdispatcher.read(Socketdispatcher.java:39) ~[?:1.8.0_65]

​ at sun.nio.ch.IoUtil.readIntoNativeBuffer(IoUtil.java:223) ~[?:1.8.0_65]

​ at sun.nio.ch.IoUtil.read(IoUtil.java:192) ~[?:1.8.0_65]

​ at sun.nio.ch.socketChannelImpl.read(SocketChannelImpl.java:380) ~[?:1.8.0_65]

​ at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.48.Final.jar:4.1.48.Final]

​ at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]

level: ERROR

method: com.xxl.job.core.server.EmbedServer$EmbedHttpServerHandler-exceptionCaught:238

2、原因及其解决办法

主要是最近换了阿里云的SLB服务,云提供商lb的健康检查引发此问题。

执行器的9999端口,分别在阿里云和腾讯云配置了lb,而且是tcp协议的。而xxljob调度中心与执行器的心跳底层是依赖netty进行的http协议维持。

解决办法如下:

  • 9999端口在lb上配置http协议;

  • 关闭lb心跳检查;

  • 自定义tcp协议;

  • 关闭lb;

  • 终极方案 - 关闭 EmbedServer 的日志打印

    logging.level.com.xxl.job.core.server.EmbedServer = OFF

阿里云SLB监听机制:

3、参考资料

xxl-job issue1088

阿里云SLB

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐