Bug #38119 NET Connector returns unuasual error
Submitted: 15 Jul 2008 2:06 Modified: 24 Jul 2008 18:01
Reporter: Jared Sullivan (Silver Quality Contributor)
Status: Closed
Category:Connector/Net Severity:S3 (Non-critical)
Version:5.2.2 OS:Any (Windows)
Assigned to: Target Version:
Tags: wait_timeout, failed, stream, Writing, open, closed

[15 Jul 2008 2:06] Jared Sullivan
Description:
Hi Reggie,

I am not satisfied with error being return after 28000 wait_timeout. 

Current Error: "Writing to stream failed"

How to repeat:
public MySql.Data.MySqlClient.MySqlDataReader DTR0;
public MySql.Data.MySqlClient.MySqlConnection CON0;
public MySql.Data.MySqlClient.MySqlCommand CMD0;

private void Button1_Click(object sender, System.EventArgs e)
{
object zObject = null;
CON0 = new MySql.Data.MySqlClient.MySqlConnection();
CON0.ConnectionString =
"server=localhost;database=information_schema;user=root;password=;port=3306";
CON0.Open();
CMD0 = new MySql.Data.MySqlClient.MySqlCommand("set wait_timeout = 5", CON0);
CMD0.ExecuteNonQuery();
System.Threading.Thread.Sleep(6000);
CMD0 = new MySql.Data.MySqlClient.MySqlCommand("select version()", CON0);
zObject = CMD0.ExecuteScalar();
Trace.WriteLine(zObject.ToString());
}

Suggested fix:
I would like to see the state of the NET connector "Closed" when server hits the 28000
second wait_timeout threshould.

I imagine that there may be a delay in the process of flagging the NET connector to
closed, but "Writing to stream has failed" is CLEARLY an incorrect message if the
connection was shutdown by the server.

Whilst I like details of inner exceptions error messages, I think the "Writing to stream"
error message needs to be replaced with State.Closed EVENT.
[18 Jul 2008 10:28] Tonci Grgin
Hi Jared.

How come this is "S1"? I see it as "S4" and completely agree with you. If you have no
objections, please lower the severity so I can set it to Verified.
[18 Jul 2008 22:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50058
[18 Jul 2008 23:04] Reggie Burnett
Fixed in 5.2.3
[18 Jul 2008 23:25] Jared Sullivan
High priority BC I need to do more extensive testing on NET con. failures.

MySQL has made internal fix also leading into 5.2.3 tree...
http://forums.mysql.com/read.php?38,187729,217696#msg-217696
[24 Jul 2008 18:01] Tony Bedford
An entry was added to the 5.2.3 changelog:

Error string was returned after a 28000 second wait_timeout. This has been changed to
generate a ConnectionState.Closed event.