Skip to content

Commit 88b57c3

Browse files
Check closed condition before attempting to set network timeout.
1 parent 6a13980 commit 88b57c3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ void quietlyCloseConnection(final Connection connection, final String closureRea
128128
try {
129129
LOGGER.debug("{} - Closing connection {}: {}", poolName, connection, closureReason);
130130
try {
131-
setNetworkTimeout(connection, SECONDS.toMillis(15));
132-
}
133-
finally {
131+
if (!connection.isClosed()) {
132+
setNetworkTimeout(connection, SECONDS.toMillis(15));
133+
}
134+
} finally {
134135
connection.close(); // continue with the close even if setNetworkTimeout() throws
135136
}
136137
}

0 commit comments

Comments
 (0)