-
Notifications
You must be signed in to change notification settings - Fork 433
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
isValid hangs regardless timeout #1128
Comments
Hi @PiotrKlimczak , Thanks for creating the issue, we will investigate and get back to you soon. |
Just to update our findings. Our implementation of is valid:
|
Hi @PiotrKlimczak , |
Hi @PiotrKlimczak , |
@ulvii @PiotrKlimczak Was this ever fixed? I am experiencing the exact same issue above on version 8.4.1 of the MSSQL JDBC driver when connecting to a Azure managed DB. Intermittent network dropouts will cause the isValid checks in the connection pool manager to hang and it brings down the entire server due to open locks in the connection pool manager. |
Hi @bdw429s , Thanks for reporting the details and confirming that the issue happens with newer versions of the driver. Is using socketTimeout connection property an option for you? This can prevent the "hang" and throw an exception immediately if the connection is invalid. |
Hi @ulvii I can't directly control the socket timeout in use, and I'm currently in discussion with the developers of the app server I use to confirm what the socket time out is that's being used. |
Hello, experiencing the same issue with driver version 9.4.0. Are there any plans for a fix? |
hi @ionutioio, sorry but there is no timeline for this fix at the moment. |
Driver version
Driver 7.2.2-jre8
SQL Server version
SQL 2016 Enterprise with multi-subnet HA
Client Operating System
Centos 7.6
JAVA/JVM version
Oracle JDK 1.8.192
Table schema
N/A
Problem description
Expected behaviour:
Invoking isValid operation on connection with the timeout parameter should not take longer than the timeout configured
Actual behaviour:
If DB failover happens, sometimes we are getting TCP socket read hanging forever in JDBC Driver (see stacktrace below).
This causes our connection pool to completely hang, as write lock acquired on connection pool object is never released during testing if connections in pool are healthy.
Currently as per implementation isValid timeout is set as query timeout, but if I understand the code correctly, this is server-side timeout, while our problem happens on the client side.
Therefore the current implementation of isValid timeout is not handling correctly client-side problems.
Error message/stack trace:
N/A as everything hangs
Any other details that can be helpful:
I believe this is similar problem to that one: Database connection hangs on failover from one node to another #764
Except we are getting it almost every time.
I think the solution might be to temporarily change TCP Socket timeout from the one set by connection parameter, to the one set in isValid parameter to make sure TCP timeout equals to isValid timeout, then after successful validation change TCP timeout to original value.
JDBC trace logs
Thread dump:
Reproduction code
The text was updated successfully, but these errors were encountered: