Bug #8024 Thread terminated during query
Submitted: 19 Jan 2005 22:21 Modified: 15 Dec 2011 16:39
Reporter: Bob Dankert Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:1.0.3 OS:Microsoft Windows (XP SP2)
Assigned to: Reggie Burnett CPU Architecture:Any

[19 Jan 2005 22:21] Bob Dankert
Description:
I receive an error when a thread terminates which is in the middle of a query.

The error and information is as follows:

An unspecified SQL/ODBC error occured.
MySql.Data.MySqlClient.MySqlException: Connection unexpectedly terminated ---> System.IO.IOException: Unable to read data from the transport connection. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
   at MySql.Data.MySqlClient.PacketReader.Read(Byte[]& buffer, Int64 pos, Int64 len)
   --- End of inner exception stack trace ---
   at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection)
   at MySql.Data.MySqlClient.NativeDriver.Configure(MySqlConnection connection)
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at MyDBTools.DBExecute.executeMySqlQuery(DBConnect connection, String DBSQL)

How to repeat:
Terminate a thread in the middle of a query.
[26 Jan 2005 18:52] Jorge del Conde
Hi

Can you please send us a test case that reproduces this behaviour ?

Thanks a lot!
[26 Jan 2005 18:56] Bob Dankert
This is not an error I have received frequently during thread termination, in fact probably less than 1% of the time a thread terminates.  I suspect there may be a small method or routine which does not handle the ThreadingException thrown to the method and causes the error.  

I will see if I can develop a test case which consistently replicates the error, but I suspect this would be difficult as this is a timing issue, which changes on each machine.
[1 Mar 2005 0: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".
[15 Dec 2011 16:39] Bob Dankert
I was never able to replicate this further, I'm sure it was fixed in future versions.  Closing bug.