Bug #1621 fetching big rowset (about 1.4 million rows) will craches MySQL Driver
Submitted: 22 Oct 2003 3:02 Modified: 28 Mar 2014 12:06
Reporter: [ name withheld ] Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:3.0.8, 3.0.9 OS:Linux (Linux Mandrake 9.1)
Assigned to: Alexander Soklakov CPU Architecture:Any

[22 Oct 2003 3:02] [ name withheld ]
Description:
Wed Oct 22 04:47:54 EST 2003 
java.sql.SQLException: Communication link failure: java.io.EOFException, 
underlying cause: null 
 
** BEGIN NESTED EXCEPTION **  
 
java.io.EOFException 
 
STACKTRACE: 
 
java.io.EOFException 
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1242) 
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1428) 
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775) 
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1752) 
        at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:851) 
        at 
com.mysql.jdbc.RowDataDynamic.nextRecord(RowDataDynamic.java:309) 
        at com.mysql.jdbc.RowDataDynamic.next(RowDataDynamic.java:281) 
        at com.mysql.jdbc.ResultSet.next(ResultSet.java:2504) 
        at com.keysurvey.utils.DBUtils.selectJoinGroupLoop(DBUtils.java:745) 
        at 
com.keysurvey.report.results.ReportResults.loadResultsToCounter(ReportResults.java:488) 
        at 
com.keysurvey.report.results.ReportResults.loadResults(ReportResults.java:438) 
        at 
com.keysurvey.report.results.ReportResults.loadResults(ReportResults.java:427) 
        at 
com.keysurvey.report.results.ReportResults.beginLoading(ReportResults.java:101) 
        at 
com.keysurvey.report.results.ReportResults.beginLoading(ReportResults.java:76) 
        at com.keysurvey.report.html.ReportHTML.Normal(ReportHTML.java:238) 
        at 
com.keysurvey.report.html.ReportHTML.printNormal(ReportHTML.java:101) 
        at org.apache.jsp.report_jsp._jspService(report_jsp.java:161) 
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
        at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) 
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) 
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) 
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) 
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 
        at com.keysurvey.survey.servlet.GZIPFilter.doFilter(GZIPFilter.java:163) 
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) 
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) 
        at com.keysurvey.utils.FileUploadFilter.doFilter(FileUploadFilter.java:30) 
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) 
..... 
 
** END NESTED EXCEPTION ** 
 
 
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1527) 
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775) 
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1752) 
        at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:851) 
        at 
com.mysql.jdbc.RowDataDynamic.nextRecord(RowDataDynamic.java:309) 
        at com.mysql.jdbc.RowDataDynamic.next(RowDataDynamic.java:281) 
        at com.mysql.jdbc.ResultSet.next(ResultSet.java:2504) 
        at com.keysurvey.utils.DBUtils.selectJoinGroupLoop(DBUtils.java:745) 
        at 
com.keysurvey.report.results.ReportResults.loadResultsToCounter(ReportResults.java:488) 
        at 
com.keysurvey.report.results.ReportResults.loadResults(ReportResults.java:438) 
        at 
com.keysurvey.report.results.ReportResults.loadResults(ReportResults.java:427) 
        at 
com.keysurvey.report.results.ReportResults.beginLoading(ReportResults.java:101) 
        at 
com.keysurvey.report.results.ReportResults.beginLoading(ReportResults.java:76) 
        at com.keysurvey.report.html.ReportHTML.Normal(ReportHTML.java:238) 
        at 
com.keysurvey.report.html.ReportHTML.printNormal(ReportHTML.java:101) 
        at org.apache.jsp.report_jsp._jspService(report_jsp.java:161) 
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) 
Wed Oct 22 04:47:54 EST 2003 
java.sql.SQLException: Communication link failure: java.io.IOException, 
underlying cause: Unexpected end of input stream 
 
** BEGIN NESTED EXCEPTION **  
 
java.io.IOException 
MESSAGE: Unexpected end of input stream 
 
STACKTRACE: 
 
java.io.IOException: Unexpected end of input stream 
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1405) 
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775) 
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1752) 
        at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:851) 
        at 
com.mysql.jdbc.RowDataDynamic.nextRecord(RowDataDynamic.java:309) 
        at com.mysql.jdbc.RowDataDynamic.next(RowDataDynamic.java:281) 
        at com.mysql.jdbc.RowDataDynamic.close(RowDataDynamic.java:230) 
        at com.mysql.jdbc.ResultSet.realClose(ResultSet.java:3633) 
        at com.mysql.jdbc.ResultSet.close(ResultSet.java:2277) 
        at com.keysurvey.utils.DBUtils.selectJoinGroupLoop(DBUtils.java:772) 
 
 
 
 

How to repeat:
bug can be reproduce only after start application, if fetching several rows - bug 
can't be reproduced.
[30 Oct 2003 8:26] Mark Matthews
How long does it take before you get this exception? If you don't process the rows fast enough, MySQL will close the connection (you'll need to adjust the 'net_read_timeout' variable on the server to prevent this).

Also, is there any _good_ reason you're returning 1.4mio rows? In many cases it is not a good practice to return this many rows (you're ususally doing something that can be handled by the database server itself in a query).
[16 Jun 2008 10:38] Mirza Hadzic
Same here, I need to load very big table to memory and this bug is what happpens. In MySQL Administrator "timeout settings" are set to default (0, 28800, 30, 60, 28800). Which timeout to change?
[28 Mar 2014 12:06] Alexander Soklakov
I close this report as "Can't repeat" because there is no feedback for a long time and codebase is too old. Please, feel free to reopen it if the problem still exists in current driver.