Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

druid版本1.1.1出现ERROR c.alibaba.druid.pool.DruidDataSource - discard connection #2636

Open
jungleming opened this issue Jun 11, 2018 · 4 comments

Comments

@jungleming
Copy link

使用druid版本1.1.1,闲置一段时间出现以下错误
ERROR c.alibaba.druid.pool.DruidDataSource - discard connection
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,213,665 milliseconds ago. The last packet sent successfully to the server was 63,213,666 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
请问是什么原因导致的,还望能协助解决一下

@cloudcard
Copy link

网络闪断后再请求出现过类似的问题,版本1.1.10,
2018-06-11 13:39:32.522 ERROR 17032 --- [http-nio-8080-exec-3] c.a.d.p.DruidPooledStatement :
CommunicationsException, druid version 1.1.10, jdbcUrl : jdbc:mysql://xxx.mysql.rds.aliyuncs.com:3306/xx?useSSL=false&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai, testWhileIdle true, idle millis 48915, minIdle 10, poolingCount 8, timeBetweenEvictionRunsMillis 3600000, lastValidIdleMillis 48915, driver com.mysql.cj.jdbc.Driver, exceptionSorter com.alibaba.druid.pool.vendor.MySqlExceptionSorter
2018-06-11 13:39:32.522 ERROR 17032 --- [http-nio-8080-exec-3] c.a.d.p.DruidDataSource :
discard connection

@taotao0325
Copy link

我这里单机必现discard connection这个问题,重启应用、重启服务器都不行,咋整呢

@yuxiao97
Copy link

我这里单机必现discard connection这个问题,重启应用、重启服务器都不行,咋整呢

实在不行就配置testOnBorrow=true吧,避免这种出错,另外可以使用SpringBoot官方默认的连接池HikariCP.

@sxyseo
Copy link

sxyseo commented Feb 15, 2022

1.1.19遇到这个问题,记录下
com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 63,284,512 milliseconds ago. The last packet sent successfully to the server was 63,284,512 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants