Skip to content

Commit

Permalink
bug fixed for keepAlive
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Feb 26, 2019
1 parent f8f9286 commit d5003ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/derby.log
/src/test/resources/pool_config
/src/test/java/com/alibaba/druid/local_test
/src/test/java/com/alibaba/druid/pool/mysql/
# IntelliJ Idea
.idea/
out/
Expand Down
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.14-preview_1</version>
<version>1.1.14-preview_2</version>

<packaging>jar</packaging>
<name>druid</name>
Expand Down Expand Up @@ -463,7 +463,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.45</version>
<version>6.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -729,6 +729,12 @@
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.4.0</version>
<scope>test</scope>
</dependency>

</dependencies>
</project>
4 changes: 4 additions & 0 deletions src/main/java/com/alibaba/druid/pool/DruidDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -2939,6 +2939,10 @@ public void shrink(boolean checkTime, boolean keepAlive) {
lock.lock();
try {
discardCount++;

if (activeCount <= minIdle) {
emptySignal();
}
} finally {
lock.unlock();
}
Expand Down

0 comments on commit d5003ee

Please sign in to comment.