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

[BUG] 线程卡死在druiddatasource上 #6169

Open
yonghui-zhao opened this issue Oct 14, 2024 · 0 comments
Open

[BUG] 线程卡死在druiddatasource上 #6169

yonghui-zhao opened this issue Oct 14, 2024 · 0 comments

Comments

@yonghui-zhao
Copy link

yonghui-zhao commented Oct 14, 2024

Database Type

MySQL

Database Version

5.6

Druid Version

1.2.6

JDK Version

JDK11

Error SQL

druid配置:
initialSize: 10
minIdle: 10
maxActive: 100
maxWait: 600000
timeBetweenEvictionRunsMillis: 300000
minEvictableIdleTimeMillis: 30000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: false
maxPoolPreparedStatementPerConnectionSize: 20
useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=1000

设置了maxWait, 但是还有报错
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2048)
at com.alibaba.druid.pool.DruidDataSource.takeLast(DruidDataSource.java:2190)
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1682)

但是在1.2.6 源码DruidDataSource.getConnectionInternal方法中maxWait>0不会走到takeLast方法中
if (maxWait > 0) {
holder = pollLast(nanos);
} else {
holder = takeLast();
}

Testcase Code

No response

Stacktrace Info

Caused by: java.sql.SQLException: null
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1699)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1419)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1399)
at com.alibaba.druid.pool.DruidDataSource.getConnection$original$Dhe7Ai8H(DruidDataSource.java:1389)
at com.alibaba.druid.pool.DruidDataSource.getConnection$original$Dhe7Ai8H$accessor$cbxGulwB(DruidDataSource.java)
at com.alibaba.druid.pool.DruidDataSource$auxiliary$16TfPuTv.call(Unknown Source)
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:100)
at org.apache.shardingsphere.driver.jdbc.core.connection.ConnectionManager.createConnection(ConnectionManager.java:369)
at org.apache.shardingsphere.driver.jdbc.core.connection.ConnectionManager.createConnections(ConnectionManager.java:338)
at org.apache.shardingsphere.driver.jdbc.core.connection.ConnectionManager.getConnections(ConnectionManager.java:327)
at org.apache.shardingsphere.infra.executor.sql.prepare.driver.DriverExecutionPrepareEngine.group(DriverExecutionPrepareEngine.java:89)
at org.apache.shardingsphere.infra.executor.sql.prepare.AbstractExecutionPrepareEngine.prepare(AbstractExecutionPrepareEngine.java:68)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionGroupContext(ShardingSpherePreparedStatement.java:403)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery0(ShardingSpherePreparedStatement.java:275)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery$original$lWjVxhf4(ShardingSpherePreparedStatement.java:218)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery$original$lWjVxhf4$accessor$Ss1yx9lH(ShardingSpherePreparedStatement.java)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement$auxiliary$vDl0jPfE.call(Unknown Source)
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.executeQuery(ShardingSpherePreparedStatement.java)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)
... 137 common frames omitted
Caused by: java.lang.InterruptedException: null
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2048)
at com.alibaba.druid.pool.DruidDataSource.takeLast(DruidDataSource.java:2190)
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1682)

Error Info

at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2048)
at com.alibaba.druid.pool.DruidDataSource.takeLast(DruidDataSource.java:2190)
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1682)

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

1 participant