alibaba / alibaba/druid

testConnectionInternal为什么判断的是mysqlIdleMillis >= timeBetweenEvictionRunsMillis ??

Open
#3,908 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
28.2k
Forks
8.6k
PR merge metrics
No merged PRs in 30d

Description

druid版本1.1.23
mysql-connector-java版本8.0.16
类#方法:com.alibaba.druid.pool.DruidAbstractDataSource#testConnectionInternal(com.alibaba.druid.pool.DruidConnectionHolder, java.sql.Connection)
疑惑的代码:
![image](https://user-images.githubusercontent.com/21191827/90248688-c0754800-de6b-11ea-85f1-3cc4d94d8eac.png)
配置:
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
问题:超过1分钟,连接被回收,并输出了如下日志。期望超过minEvictableIdleTimeMillis的配置时间才被回收。
![image](https://user-images.githubusercontent.com/21191827/91922213-f89bd800-ecff-11ea-93f9-ed7372f6b089.png)

Contributor guide

Open the contributing guide

Research direction

Start with com.alibaba.druid.pool.DruidAbstractDataSource#testConnectionInternal and inspect why mysqlIdleMillis is compared with timeBetweenEvictionRunsMillis. Reproduce the reported behavior using Druid 1.1.23, mysql-connector-java 8.0.16, and the stated configuration. Done means explaining or correcting the eviction timing so it matches the intended minEvictableIdleTimeMillis behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.