[CONJ-79] ResultSet from previos query after "Read timed out" socket exception Created: 2013-11-21  Updated: 2014-12-09  Resolved: 2014-12-09

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.6
Fix Version/s: 1.1.8

Type: Bug Priority: Major
Reporter: Mikhail Olkhovskiy Assignee: Massimo Siani (Inactive)
Resolution: Fixed Votes: 1
Labels: None

Attachments: Java Source File TestTimeout.java    

 Description   

Steps to reproduce:
1 set connection string parameter socketTimeout = 2 (it will be 2 milliseconds see CONJ-78)
2. execute query "select 1"
3. exception: java.net.SocketTimeoutException: Read timed out
4 execute query "select 2"
5 get result of query

Expected result: 2

Actual result: 1
And now ResultSet will not correspond for all queries for this connection.



 Comments   
Comment by Vladislav Vaintroub [ 2013-11-21 ]

The only good way to fix this bug is to make SocketTimeoutException "fatal", i.e catch SocketTimeoutException, forcefull close the connection whenever it happens, and rethrow. This is unfortunate, but due to the bug in the JDK, I think it can't be handled better (socket timeout exception brings socket into unrepairable state,as in CONJ-1)

Comment by Mikhail Olkhovskiy [ 2013-11-22 ]

I think it is good idea to close connection.

Comment by Stijn [ 2014-12-09 ]

When will this bug fix be released? Considering this issue is causing wrong results to be returned (which in my opinion seems the one of the worst things that can happen), I think this bug should have a much higher priority.

Currently in production we face the problem that after a socket read timeout exception we get empty results for any query executed on the same connection (causing failed logins, ...). We will build a connector from source which includes this bug fix as we need this fix urgently in production. We would like to switch back to a stable release version as soon as possible.

Generated at Thu Feb 08 03:13:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.