没有运行查询时连接超时



我使用vertx.io 3.6.3和jasync sql v 1.1.13 for mysql作为lib来管理数据持久性。QA Env的查询很好,但有时我会收到来自lib的错误消息,如下所示:

{"@timestamp":"2020-07-15T06:36:46.933+00:00","level":"ERROR","logger_name":"com.github.jasync.sql.db.mysql.MySQLConnection","message":"<mysql-connection-14> Transport failure ","throwable_class":"IOException","stack_trace":"java.io.IOException: Connection timed outntat sun.nio.ch.FileDispatcherImpl.read0(Native Method)ntat sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)ntat sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)ntat sun.nio.ch.IOUtil.read(IOUtil.java:192)ntat sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:377)ntat io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:433)ntat io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1128)ntat io.netty.buffer.SwappedByteBuf.writeBytes(SwappedByteBuf.java:823)ntat io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)ntat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)ntat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)ntat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)ntat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)ntat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)ntat

{"@timestamp":"2020-07-15T08:27:06.070+000:00","level":"DEBUG","logger_name":"com.github.jasync.sql.db.mysql.MySQLConnection","message":"-客户端断开连接,没有运行查询"}

当异常发生时,我检查了mysql服务器,一切正常。

你能建议用哪种方法解决吗?

非常感谢。

vertx有自己的池impl,它有一个参数connectionReleaseDelay尝试将其设置为低于数据库超时的数字(以毫秒为单位(。在我设置connectionReleaseDelay=600000ms 后确认它工作

相关内容

  • 没有找到相关文章

最新更新