shardingsphere
shardingsphere copied to clipboard
How to close hikari datasource
Question
the datasource init print this:
LOG@ 2024-03-28 09:00:28.992 [BT-2] INFO-> HikariDataSource.getConnection[110]-> BasicHikari - Starting... LOG@ 2024-03-28 09:00:29.254 [BT-2] INFO-> HikariDataSource.getConnection[110]-> HikariPool-1 - Starting... LOG@ 2024-03-28 09:00:29.448 [BT-2] INFO-> HikariDataSource.getConnection[123]-> HikariPool-1 - Start completed. LOG@ 2024-03-28 09:00:29.534 [BT-2] INFO-> HikariDataSource.getConnection[110]-> HikariPool-2 - Starting... LOG@ 2024-03-28 09:00:30.092 [BT-2] INFO-> HikariDataSource.getConnection[123]-> HikariPool-2 - Start completed. LOG@ 2024-03-28 09:00:30.092 [BT-2] INFO-> HikariDataSource.getConnection[110]-> HikariPool-3 - Starting... LOG@ 2024-03-28 09:00:30.311 [BT-2] INFO-> HikariDataSource.getConnection[123]-> HikariPool-3 - Start completed. LOG@ 2024-03-28 09:00:34.735 [BT-2] INFO-> PoolBase.getAndSetNetworkTimeout[541]-> BasicHikari - Driver does not support get/set network timeout for connections. (getNetworkTimeout) LOG@ 2024-03-28 09:00:34.737 [BT-2] INFO-> HikariDataSource.getConnection[123]-> BasicHikari - Start completed.
but when my application closed , it print like this
Disconnected from the target VM, address: '127.0.0.1:53403', transport: 'socket' LOG@2024-03-28 16:52:13.893 [SpringApplicationShutdownHook] INFO-> o.springframework.boot.web.embedded.tomcat.GracefulShutdown.shutDownGracefully[53]-> Commencing graceful shutdown. Waiting for active requests to complete LOG@2024-03-28 16:52:13.896 [tomcat-shutdown] INFO-> o.springframework.boot.web.embedded.tomcat.GracefulShutdown.doShutdown[78]-> Graceful shutdown complete LOG@2024-03-28 16:52:13.908 [SpringApplicationShutdownHook] INFO-> com.zaxxer.hikari.HikariDataSource.close[350]-> BasicHikari - Shutdown initiated... LOG@2024-03-28 16:52:13.911 [SpringApplicationShutdownHook] INFO-> com.zaxxer.hikari.HikariDataSource.close[352]-> BasicHikari - Shutdown completed.
and then I see the mysql PROCESSLIST, they all still keep sleep? how can I close the dataSource?
What is your version?
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.