Skip to content
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

Connection marked as broken because of SQLSTATE(08S01) , ErrorCode(0) #1986

Closed
sudha1124 opened this issue Oct 5, 2022 · 7 comments
Closed

Comments

@sudha1124
Copy link

sudha1124 commented Oct 5, 2022

@brettwooldridge . Please help us with this issue. I have been struggling on this from past few weeks. Tried everything from forums.

we are facing below error every couple of errors (10-12 hours) consistently everyday. I have enabled leakDetection and do not see any leaks.
Connection marked as broken because of SQLSTATE(08S01) , ErrorCode(0)

Hikaricp: 4.0.3
Aurora MySql : 5.7.12
mysql-connector-java : 8.0.29
JDK: 11

The last packet successfully received from the server was 211 milliseconds ago. The last packet sent successfully to the server was 211 milliseconds ago

minimum-idle:10
maximum-pool-size:50
idle-timeout: 30000ms ( 30 secs)
leakDetectionThreshold : 120000ms ( 2 mins)
keepAliveTime: 60000ms ( 1 min, tried 10 mins too)
maxLifeTime : default ( 30 mins )

MySQL timeouts
wait_timeout: 28800secs ( 8hrs)
interactive_timeout: 28800secs ( 8hrs)
connect_timeout: 10 secs
bind-address: *
skip-networking: OFF

ConnectionString : sslMode=DISABLED&serverTimezone=UTC&useLegacyDateTimeCode=false&autoConnect=true&useUnicode=true&characterEncoding=UTF-8&tcpKeepAlive=true

@casolxia
Copy link

If there is additional network infrastructure, such as load-balancers, between your application and the database, they may be imposing a separate (shorter) timeout. The pool maxLifetime should be one minute shorter than the shortest timeout in the infrastructure path.

@parsons-smith
Copy link

@brettwooldridge We have encountered similar problem. We configue MAX_EXECUTION_TIME so that long running queries would be killed. When a query is killed, the connection is broken and could not been used. However, the server returns "SQL state [HY000]; error code [1105] ", so the connection is not recognized as broken and still remain in the pool. It will cause "Communications link failure, marked as broken because of SQLSTATE(08S01), ErrorCode(0)" when another new request uses this connection next time.
CSdoyRC8sB
r7jI2A1OWe

@brettwooldridge
Copy link
Owner

@parsons-smith I have added error code 1105 to the list of known error codes. I will make a release in the next few days.

@brettwooldridge
Copy link
Owner

@sudha1124 Also, please remove tcpKeepAlive=true and autoConnect=true from the connection parameters, these can potentially adversely impact pool management. If you need keep-alive behavior, consider setting keepaliveTime to some reasonable value.

@mokamoto12
Copy link

@brettwooldridge There seem to be several similar issues here (#1960, #2015). I think it would be nice if users could handle errors freely. I am trying to address the issue here #2031. If you don't mind, please let me know what I can do to merge this one. Thank you.

@yakirgb
Copy link

yakirgb commented Jun 5, 2023

@brettwooldridge version 5.0.2 released ?

@casolxia
Copy link

casolxia commented Jun 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants