From 82c82adfdaf8a56763de0780780008bf0eff4eb7 Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Tue, 24 Sep 2024 01:21:10 +0800 Subject: [PATCH] Skip Connection::setNetworkTimeout if PoolBase::shutdownNetworkTimeoutExecutor is called (#2147) Fix GH-2130 --- src/main/java/com/zaxxer/hikari/pool/PoolBase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zaxxer/hikari/pool/PoolBase.java b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java index eb59d1d0..0867db5d 100644 --- a/src/main/java/com/zaxxer/hikari/pool/PoolBase.java +++ b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java @@ -73,7 +73,7 @@ abstract class PoolBase private static final int MINIMUM_LOGIN_TIMEOUT = Integer.getInteger("com.zaxxer.hikari.minimumLoginTimeoutSecs", 1); private int networkTimeout; - private int isNetworkTimeoutSupported; + private volatile int isNetworkTimeoutSupported; private int isQueryTimeoutSupported; private int defaultTransactionIsolation; private int transactionIsolation; @@ -244,6 +244,7 @@ abstract class PoolBase void shutdownNetworkTimeoutExecutor() { + isNetworkTimeoutSupported = UNINITIALIZED; if (netTimeoutExecutor instanceof ThreadPoolExecutor) { ((ThreadPoolExecutor) netTimeoutExecutor).shutdownNow(); }