druid 版本 1.1.9
主备切换后一段时间,持续性报错,无法恢复
经sql 洞察核实 查询请求没有打到新的rds上
配置
sockettimeout 15s
querytimeout 10s (超时触发kill)
猜测:
statementtimeout 抛出的是MySQLTimeoutException, MySqlExceptionSorter只判断了 CommunicationsException 引起未回收连接,帮忙核实下,看看有没啥办法
result:
Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
expect:
com.alibaba.druid.pool.DruidPooledStatement DruidPooledStatement.java 296 errorCheck
message: CommunicationsException, druid version 1.1.9, jdbcUrl : jdbc:mysql://xxx&socketTimeout=15000, testWhileIdle true, idle millis 7, minIdle 8, poolingCount 13, timeBetweenEvictionRunsMillis 60000, lastValidIdleMillis 7, driver com.mysql.jdbc.Driver, exceptionSorter com.alibaba.druid.pool.vendor.MySqlExceptionSorter
message: discard connection
stack_trace: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 931,296 milliseconds ago. The last packet sent successfully to the server was 13,843 milliseconds ago.
at jdk.internal.reflect.GeneratedConstructorAccessor79.newInstance(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) ~[mysql-connector-java-5.1.22.jar:na]
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117) ~[mysql-connector-java-5.1.22.jar:na]
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3851) ~[mysql-connector-java-5.1.22.jar:na]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2471) ~[mysql-connector-java-5.1.22.jar:na]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651) ~[mysql-connector-java-5.1.22.jar:na]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734) ~[mysql-connector-java-5.1.22.jar:na]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155) ~[mysql-connector-java-5.1.22.jar:na]
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322) ~[mysql-connector-java-5.1.22.jar:na]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:228) ~[druid-1.1.9.jar:1.1.9]
......
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.net.SocketException: Broken pipe (Write failed)
at java.base/java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:na]
at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110) ~[na:na]
at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150) ~[na:na]
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ~[na:na]
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) ~[na:na]
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3832) ~[mysql-connector-java-5.1.22.jar:na]
... 113 common frames omitted
1条答案
按热度按时间z2acfund1#
升级到最新版本1.1.24试试看