HikariCP icon indicating copy to clipboard operation
HikariCP copied to clipboard

networkTimeoutExecutor maybe shutdown before use it

Open Young0516 opened this issue 9 months ago • 1 comments

background: I try to integrate hikari with clickhouse-jdbc. Screenshot2023_11_01_145233

when I invoke dataSource.close(); I got an error java.util.concurrent.RejectedExecutionException: Task com.clickhouse.jdbc.internal.ClickHouseConnectionImpl$$Lambda$1769/0x0000000800dbd840@4dd95dfd rejected from java.util.concurrent.ThreadPoolExecutor@165a9184[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 50] at java.base/java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2055) at java.base/java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:825) at java.base/java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1355) at com.clickhouse.jdbc.internal.ClickHouseConnectionImpl.setNetworkTimeout(ClickHouseConnectionImpl.java:1054) at com.zaxxer.hikari.pool.PoolBase.setNetworkTimeout(PoolBase.java:610) at com.zaxxer.hikari.pool.PoolBase.quietlyCloseConnection(PoolBase.java:142) at com.zaxxer.hikari.pool.HikariPool.lambda$closeConnection$3(HikariPool.java:539) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)

with my debug, I guess the networkTimeoutExecutor maybe shutdown before softEvictConnections completed

Screenshot2023_11_01_141334

hikari version: 5.0.1

Young0516 avatar Nov 01 '23 06:11 Young0516

I'm trying to fix this by https://github.com/brettwooldridge/HikariCP/pull/2147, would you take a look? @Young0516

quaff avatar Nov 27 '23 03:11 quaff