首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有运行查询时连接超时

没有运行查询时连接超时
EN

Stack Overflow用户
提问于 2020-07-15 15:42:56
回答 1查看 280关注 0票数 1

我使用vertx.io 3.6.3和jasync-sql v1.1.13 for mysql作为库来管理数据持久化,QA环境的查询没有问题,但有时我会收到来自库的错误消息,如下所示:

{"@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 out\n\tat sun.nio.ch.FileDispatcherImpl.read0(Native Method)\n\tat sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)\n\tat sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)\n\tat sun.nio.ch.IOUtil.read(IOUtil.java:192)\n\tat sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:377)\n\tat io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:433)\n\tat io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1128)\n\tat io.netty.buffer.SwappedByteBuf.writeBytes(SwappedByteBuf.java:823)\n\tat io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)\n\tat

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

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

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

非常感谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-07-18 15:03:12

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62909896

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档