From c80c28153a62f9be5e1d1c1dc098cd523b8a0080 Mon Sep 17 00:00:00 2001 From: Maximus Date: Wed, 3 Aug 2022 16:04:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-77015=20Druid=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=97=B6=E6=8A=9B=E5=87=BA=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=B8=8D=E6=96=B9=E4=BE=BF=E7=9B=B4=E6=8E=A5=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=8E=9F=E5=9B=A0=EF=BC=8C10.0=E6=98=AF=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/third/alibaba/druid/pool/DruidDataSource.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java b/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java index b27276b28..e2c9028f1 100644 --- a/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java +++ b/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java @@ -1387,7 +1387,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat || realDriverClassName.equals(JdbcConstants.POLARDB_DRIVER)) { this.validConnectionChecker = new PGValidConnectionChecker(); } else if (realDriverClassName.equals(JdbcConstants.OCEANBASE_DRIVER) - || (realDriverClassName.equals(JdbcConstants.OCEANBASE_DRIVER2))) { + || (realDriverClassName.equals(JdbcConstants.OCEANBASE_DRIVER2))) { DbType dbType = DbType.of(this.dbTypeName); this.validConnectionChecker = new OceanBaseValidConnectionChecker(dbType); } @@ -1830,7 +1830,11 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat String errorMessage = buf.toString(); if (createError != null) { - throw new GetConnectionTimeoutException(errorMessage, createError); + if (createError instanceof SQLException) { + throw (SQLException)createError; + } else { + throw new GetConnectionTimeoutException(errorMessage, createError); + } } else { throw new GetConnectionTimeoutException(errorMessage); } From fad55cd4bc60d58c0606fcbc22a038de47e600c3 Mon Sep 17 00:00:00 2001 From: Maximus Date: Fri, 5 Aug 2022 15:19:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-76958=20Druid=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E7=9A=84=E9=87=8D=E8=AF=95=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9C=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/third/alibaba/druid/pool/DruidDataSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java b/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java index e2c9028f1..a6b796507 100644 --- a/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java +++ b/fine-druid/src/main/java/com/fr/third/alibaba/druid/pool/DruidDataSource.java @@ -1482,7 +1482,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat try { poolableConnection = getConnectionInternal(maxWaitMillis); } catch (GetConnectionTimeoutException ex) { - if (notFullTimeoutRetryCnt <= this.notFullTimeoutRetryCount && !isFull()) { + if (notFullTimeoutRetryCnt < this.notFullTimeoutRetryCount && !isFull()) { notFullTimeoutRetryCnt++; if (LOG.isWarnEnabled()) { LOG.warn("get connection timeout retry : " + notFullTimeoutRetryCnt);