Bug #16192 Deadlock
Submitted: 4 Jan 2006 16:04 Modified: 31 Mar 2014 10:46
Reporter: Arnaud de La Sudrie Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version: mysql-connector-java-5.0-nightly-200512 OS:Linux (linux)
Assigned to: Assigned Account CPU Architecture:Any

[4 Jan 2006 16:04] Arnaud de La Sudrie
Description:
I have the following error with the  mysql-connector-java-5.0-nightly-20051215 version. I would like to know if this big while be fixed in the release.

Java stack information for the threads listed above:
===================================================
"tcpConnection-6802-798":
        at com.mysql.jdbc.Connection.getCharsetConverter(Connection.java:3214)
        - waiting to lock <0x75698558> (a com.mysql.jdbc.Connection)
        at com.mysql.jdbc.Field.getStringFromBytes(Field.java:583)
        at com.mysql.jdbc.Field.getTableName(Field.java:644)
        at com.mysql.jdbc.Field.getFullName(Field.java:416)
        at com.mysql.jdbc.ResultSet.buildIndexMapping(ResultSet.java:596)
        at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:937)
        - locked <0x773ce490> (a com.mysql.jdbc.ResultSet)
        at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2422)
        at com.phonevalley.smsV3.bean.StatListeDiff.getNbSMSTotal(StatListeDiff.java:75)
        at com.phonevalley.smsV3.bean.StatListeDiff.getPourcent(StatListeDiff.java:152)
        at com.phonevalley.smsV3.bean.StatListeDiff.getPourcentTerminal(StatListeDiff.java:188)
        at _smsV3._stats._stats_0liste_0do__jsp._jspService(_stats_0liste_0do__jsp.java:171)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
        at com.caucho.jsp.Page.subservice(Page.java:506)
        at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
        at com.caucho.server.http.Invocation.service(Invocation.java:315)
        at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
        at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
        at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
        at java.lang.Thread.run(Thread.java:534)
"resin-alarm":
        at com.mysql.jdbc.ResultSet.close(ResultSet.java:738)
        - waiting to lock <0x773ce490> (a com.mysql.jdbc.ResultSet)
        at com.mysql.jdbc.Statement.realClose(Statement.java:1848)
        at com.mysql.jdbc.Connection.closeAllOpenStatements(Connection.java:2159)
        at com.mysql.jdbc.Connection.realClose(Connection.java:4511)
        at com.mysql.jdbc.Connection.close(Connection.java:2131)
        - locked <0x75698558> (a com.mysql.jdbc.Connection)
        at com.caucho.sql.XAConnectionAdapter.close(XAConnectionAdapter.java:453)
        at com.caucho.sql.PoolItem.close(PoolItem.java:631)
        at com.caucho.sql.DBPool.handleAlarm(DBPool.java:1721)
        at com.caucho.util.Alarm$AlarmThread.evaluateAlarm(Alarm.java:319)
        at com.caucho.util.Alarm$AlarmThread.run(Alarm.java:279)

Found 1 deadlock.

Regards

Arnaud de La Sudrie

How to repeat:
Use this driver with resin 2.1.12 anf set the max-active-time to a small value.
[12 Jan 2006 15:27] Mark Matthews
From your stack trace, it looks like your application (or the container) is trying to close a result set (by closing the connection) that it is also reading from (via .getInt()) at the same time. Those methods on ResultSet are synchronized, so there's a chance the deadlock _might_ be happening in your container.

Other than the low max_active_time, can you determine if there's another reason the container would be attempting to close the connection before your application is done using it?
[13 Feb 2006 0:01] 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".
[31 Mar 2014 10:46] Alexander Soklakov
Duplicate of Bug#18719.