-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关闭DruidDataSource时连接池停止增加新建连接 #4196
Conversation
check closed status before calling incrementPoolingCount()
这种方式是不是只能解决原本DruidDataSource已经连接成功了,然后需要切换到另一个数据库连接的情景。 如果是原本是连接失败的,close之后,CreateConnectionThread的线程卡在了死循环里面了,不停的想要创建连接,一直都创建失败 |
|
好的,谢谢解答。 |
我最近也碰到了类似的问题,DruidDataSource之前是连接失败的,DruidDataSource Close之后,CreateConnectionThread没有退出,初步排查了一下,是close方法会将CreateConnectionThread的线程状态设置为interrupt,但是不知道为啥(没定位到),这个interrupt的线程状态没有被InterruptedException捕获就被设置false了,导致CreateConnectionThread没法退出,一直在重复创建连接 复现方法:
|
#4195