Bug #113119 Java deadlock using mysql-connector-java-8.0.20.jar
Submitted: 17 Nov 2023 9:29 Modified: 24 Dec 2023 6:15
Reporter: Laurent F Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:8.0.20 OS:CentOS
Assigned to: MySQL Verification Team CPU Architecture:Any

[17 Nov 2023 9:29] Laurent F
Description:
Hi,

My application is running simple query in production.

At the same time, the same user used twice a function in my application at the same time and we got a java deadlock in mysql classes

Found deadlock:
"undertow task-84"
  waiting to lock com.mysql.cj.jdbc.result.ResultSetImpl@3d0e5e5f
  which is held by "undertow task-70"
"undertow task-70"
  waiting to lock com.mysql.cj.jdbc.ConnectionImpl@686aacee
  which is held by "undertow task-84"

"undertow task-70" #1287
   java.lang.Thread.State: BLOCKED
        at com.mysql.cj.jdbc.result.ResultSetImpl.setWrapperStatement(ResultSetImpl.java:2071)
        - waiting to lock com.mysql.cj.jdbc.ConnectionImpl@686aacee
        - locked on com.mysql.cj.jdbc.result.ResultSetImpl@3d0e5e5f
        at com.mysql.cj.jdbc.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:582)
        at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)

"undertow task-84" #1313
   java.lang.Thread.State: BLOCKED
        at com.mysql.cj.protocol.a.result.NativeResultset.getNextResultset(NativeResultset.java:138)
        - waiting to lock com.mysql.cj.jdbc.result.ResultSetImpl@3d0e5e5f
        at com.mysql.cj.jdbc.StatementImpl.removeOpenResultSet(StatementImpl.java:490)
        - locked on com.mysql.cj.jdbc.ConnectionImpl@686aacee
        at com.mysql.cj.jdbc.result.ResultSetImpl.realClose(ResultSetImpl.java:1863)
        - locked on com.mysql.cj.jdbc.ConnectionImpl@686aacee
        at com.mysql.cj.jdbc.result.ResultSetImpl.close(ResultSetImpl.java:524)
        at com.mysql.cj.jdbc.StatementImpl.realClose(StatementImpl.java:1783)
        at com.mysql.cj.jdbc.ClientPreparedStatement.realClose(ClientPreparedStatement.java:1310)
        - locked on com.mysql.cj.jdbc.ConnectionImpl@686aacee
        at com.mysql.cj.jdbc.StatementImpl.close(StatementImpl.java:428)
        at com.mysql.cj.jdbc.StatementWrapper.close(StatementWrapper.java:466)
        at com.mysql.cj.jdbc.PreparedStatementWrapper.close(PreparedStatementWrapper.java:930)
        - locked on com.mysql.cj.jdbc.PreparedStatementWrapper@4b37c5d
        at org.jboss.jca.adapters.jdbc.WrappedStatement.internalClose(WrappedStatement.java:1312)
        at org.jboss.jca.adapters.jdbc.WrappedConnection.close(WrappedConnection.java:255)
        - locked on org.jboss.jca.adapters.jdbc.jdk7.WrappedConnectionJDK7@75b4f459

I checked the changelog of all mysql-connector and it's not an open issue

How to repeat:
It's a random problem
[24 Nov 2023 6:15] MySQL Verification Team
Hello Laurent,

Thank you for the bug report.
Could you please provide exact test case to reproduce the issue at our end?

Regards,
Ashwini Patil
[25 Dec 2023 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".