Bug #45978 | Silent problem when net_write_timeout is exceeded | ||
---|---|---|---|
Submitted: | 6 Jul 2009 18:42 | Modified: | 8 Apr 2010 14:29 |
Reporter: | Pavel Bazanov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 5.1.36 | OS: | Windows |
Assigned to: | Reggie Burnett | CPU Architecture: | Any |
Tags: | net_write_timeout FormatException |
[6 Jul 2009 18:42]
Pavel Bazanov
[14 Jul 2009 9:49]
Pavel Bazanov
Any news?
[16 Jul 2009 7:19]
Tonci Grgin
Of course there are Pavel. First of all, it really seems that Bug#39878 is very much related. Secondly, these wait timeouts are for disconnect, stalled clients whose threads MySQL server kills with sigusr1 or another signal about timeout (depends on threads lib on box). My opinion is that connectors should check for this just like C API does (cl client throws 2013). Let me consult more with connectors folks.
[20 Jul 2009 9:13]
Tonci Grgin
I'd say this *is* a bug based on my last post.
[21 Aug 2009 18:50]
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/81336 708 Reggie Burnett 2009-08-21 changed MySqlStream.Read to throw an exception if the stream end is reached. This is not ideal but we can't change it too much here in 5.2.8. We'll look at a bigger change in 6.2. (bug #45978)
[21 Aug 2009 18:57]
Reggie Burnett
Fixed in 5.2.8. We no longer support 5.1. The bug is not present in 6.0+
[4 Sep 2009 23:03]
Pavel Bazanov
MySql Server 5.1.38 & Connector/Net 6.1.1 EndOfStreamException exception is thrown. But maybe it's better to throw something like NetWriteTimeoutExceededException instead of EndOfStreamException? It would be easier for developers to understand real cause of the exception. PS. Maybe it's better to change NetWriteTimeoutExpiring() test to wait for EndOfStreamException ?
[9 Sep 2009 10:08]
Tony Bedford
An entry was added to the 5.2.8 changelog: If the application slept for longer than the specified net_write_timeout, and then resumed Read operations on a connection, then the application failed silently.
[2 Apr 2010 19:54]
Pavel Bazanov
Guys, When I run the following test from Visual Studio (with the help of ReSharper, making it possible to run NUnit tests from VS) it always passes, but when I run it from NUnit GUI application it always fails: [Test, ExpectedException(typeof(MySqlException))] public void Bug45978ShouldNotAppearAnymore() { using (MySqlConnection conn = DB.ConnectToDb()) { var command = new MySqlCommand("", conn); command.CommandText = "SET net_write_timeout = 1"; command.ExecuteNonQuery(); command.CommandText = "SELECT * FROM parts LIMIT 100000"; using (MySqlDataReader reader = command.ExecuteReader()) { Thread.Sleep(2000); while (reader.Read()) { object o = reader["PartN"]; } } } } Any comments?
[8 Apr 2010 14:29]
Pavel Bazanov
I installed a new version of ReSharper (5.0) and the test now also fails inside Visual Studio - exception is not thrown. Why exception is not thrown anymore?