-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
MSSQL Server connection goes to sleeping state and blocking another queries #2231
Comments
@brettwooldridge can you please help here? |
quaff
added a commit
to quaff/HikariCP
that referenced
this issue
Sep 27, 2024
@ravirajsinh-lab I created #2247 to allow configuring |
quaff
added a commit
to quaff/HikariCP
that referenced
this issue
Oct 14, 2024
quaff
added a commit
to quaff/HikariCP
that referenced
this issue
Oct 14, 2024
quaff
added a commit
to quaff/HikariCP
that referenced
this issue
Oct 14, 2024
This should be resolvable by configuring the socket timeout for your driver and ensuring that keepalive is properly configured, see Connection Recovery for MSSQL. I do recommend configuring keepalive at the OS level, regardless of what drivers say they support, see Setting OS TCP Keepalive. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am encountering an issue with a sleeping connection in MSSQL production server. My application is a multi-tenant application that connects to 6 databases and has 30 Tomcat instances. I have used the following libraries:
Hikari cp config
I have attempted to adjust the above Hikari pool configuration multiple times, but I am still receiving the sleeping connection issue, which is causing other queries to become blocked. When checking sp_whoisactive in the MSSQL server, I can see that sessions are in sleeping states for hours. It appears that HikariCP is not closing connections properly.
During my investigation of the HikariCP code, I discovered that in the method PoolBase.quietlyCloseConnection, it attempts to close connections. However, I found that it sets the NetworkTimeout hardcoded to 15 seconds. This leads me to question whether this shorter timeout is causing the connections to not be closed properly.
Can you provide any assistance? Thank you in advance.
Note: There is an Azure gateway between the application and database.
The text was updated successfully, but these errors were encountered: