Bug #86553 The thread hanging up in MysqlIO.skipFully. Just like endless loop.
Submitted: 2 Jun 2017 9:09 Modified: 5 Jul 2017 12:24
Reporter: ziheng wen Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.1.24 and 3.1.38 and may be others OS:Linux
Assigned to: Assigned Account CPU Architecture:Any
Tags: MysqlIO.skipFully;SocketInputStream.available

[2 Jun 2017 9:09] ziheng wen
Description:
My jstack message just like the following section.
It will never return. There is a "while(){}" in MysqlIO.skipFully.
It is similar to bug #73053: https://bugs.mysql.com/bug.php?id=73053.

Please help me to make clear what happens here.

java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAvailable(Native Method)
        at java.net.AbstractPlainSocketImpl.available(AbstractPlainSocketImpl.java:478)
        - locked <0x000000079a3eaab8> (a java.net.SocksSocketImpl)
        at java.net.SocketInputStream.available(SocketInputStream.java:238)
        at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:61)
        at com.mysql.jdbc.util.ReadAheadInputStream.skip(ReadAheadInputStream.java:283)
        at com.mysql.jdbc.MysqlIO.skipFully(MysqlIO.java:2974)
        at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2171)
        at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1964)
        at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3316)
        at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:463)
        at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3040)
        at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2288)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2681)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2551)
        - locked <0x0000000795bc53f0> (a com.mysql.jdbc.JDBC4Connection)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
        - locked <0x0000000795bc53f0> (a com.mysql.jdbc.JDBC4Connection)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
        - locked <0x0000000795bc53f0> (a com.mysql.jdbc.JDBC4Connection)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:67)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
        at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
        at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
        at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)

How to repeat:
config:
jdbc:mysql://${jdbc.base.host}:${jdbc.base.port}/${jdbc.base.dbname}?useUnicode=true&amp;zeroDateTimeBehavior=convertToNull&amp;autoReconnect=true

and do not config connectTimeout or socketTimeout value

use connector/J version 3.1.24 or 3.1.38

when the mysql server close the connection firstly, then client just waiting like what description said.
[5 Jun 2017 12:24] Chiranjeevi Battula
Hello ziheng,

Thank you for the bug report.
Could you please provide repeatable test case (exact steps, sample code, Connector & MySQL version etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[6 Jul 2017 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".