Bug #38796 | MySqlConnection.open() hangs if disconnect connection | ||
---|---|---|---|
Submitted: | 14 Aug 2008 12:31 | Modified: | 10 Jun 2009 9:42 |
Reporter: | Glen Boonzaier | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 5.2.2.0 | OS: | Windows (XP) |
Assigned to: | CPU Architecture: | Any | |
Tags: | MySqlConnection open hangs disconnect connection |
[14 Aug 2008 12:31]
Glen Boonzaier
[14 Aug 2008 12:41]
Glen Boonzaier
The same problem seems to exist if I disconnect during the ping method. The timeout is ignored and it just hangs there endlessly. I reconnected my modem after about 30 seconds and it then continued without a problem.
[2 Oct 2008 8:06]
Tonci Grgin
Hi Glen and thanks for your report. I'm having troubles following it so I made simplified test based on your last post: MySqlConnection m_myConnection = new MySqlConnection(); m_myConnection.ConnectionString = "server=localhost; database=test; User id=root; port=****; password=*****"; m_myConnection.Open(); System.Threading.Thread.Sleep(6000); // Open succeed, put BP here and shutdown the mysql server (or do it while Sleep loops) // then execute the following code bool bRes = m_myConnection.Ping(); // bRes is false System.Data.ConnectionState state = m_myConnection.State; // state is Closed! Now, where am I supposed to put BP to get exact case as you did? Which line in the code of driver (or test)? You can not seriously expect me to click "connect" and run to disconnect network...
[3 Nov 2008 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".
[3 Nov 2008 1:24]
Jared S
Lower Connection timeout
Attachment: patch-38796.patch (application/octet-stream, text), 624 bytes.
[6 Nov 2008 6:44]
Glen Boonzaier
Hi Tonci, Sorry for this late reply, I'm sure you know how hectic things get. Basically what happened is, I told my client that there is a constant monitor before any query is done to check the database connection is still available. In a test, he disconnected his network cable as it executed the connection.Open() command and the program froze. The mysql server, sits at an overseas hosting so naturally it takes about 5 or 6 seconds to execute the Open() command. If you disconnect during that time, the driver just never responds and the program comes to a halt there. I can understand that testing on a local mysql database would be really difficult as the Open() command will execute quickly and you will have a very short window to disconnect. When I said disconnect, I do mean disconnecting the machine that is running the application with the driver on it, not the mysql server. You can perhaps just try and unplug your network cable at that point. Potential Work Around: Run a thread to connect to the database, while the thread is executing, monitor it and set your own timeout mechanism. ps. Not quiet sure what you mean by BP, but I am assuming it stands for bypass?
[5 Mar 2009 19:58]
Tonci Grgin
BreakPoint :-) Lat me look at this again tomorrow.
[17 Apr 2009 12:09]
Tonci Grgin
Tomorrow prolonged... I still don't have such bad connection to MySQL server anywhere to check on this.
[10 Jun 2009 9:42]
Tonci Grgin
This is actually a duplicate of verified report, Bug#29756.