Skip to content

Commit 4da46f5

Browse files
fixes #2265 bail out of the pool filling loop if the thread is interrupted
1 parent af4bf7f commit 4da46f5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Changes in 7.0.0
77

88
* fixed #1294 add support for HikariCredentialsProvider class
99

10+
* fixed #2265 bail out of the pool filling loop if the thread is interrupted
11+
1012
Changes in 6.3.2
1113

1214
* fixed #2342 restore module-info.class to jar file, which was lost in 6.3.1

src/main/java/com/zaxxer/hikari/pool/HikariPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,12 +777,12 @@ else if (!added)
777777

778778
/**
779779
* We only create connections if we need another idle connection or have threads still waiting
780-
* for a new connection. Otherwise we bail out of the request to create.
780+
* for a new connection. Otherwise, we bail out of the request to create.
781781
*
782782
* @return true if we should create a connection, false if the need has disappeared
783783
*/
784784
private synchronized boolean shouldContinueCreating() {
785-
return poolState == POOL_NORMAL && getTotalConnections() < config.getMaximumPoolSize() &&
785+
return poolState == POOL_NORMAL && !Thread.interrupted() && getTotalConnections() < config.getMaximumPoolSize() &&
786786
(getIdleConnections() < config.getMinimumIdle() || connectionBag.getWaitingThreadCount() > getIdleConnections());
787787
}
788788
}

0 commit comments

Comments
 (0)