Bug #6826 | Long delay when connecting to Linux MySQL server from Windows MyODBC clients | ||
---|---|---|---|
Submitted: | 25 Nov 2004 15:15 | Modified: | 28 Jan 2005 6:36 |
Reporter: | d di (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
Version: | 3.51.10 | OS: | Linux (SuSE 9, Windows 2000) |
Assigned to: | Dean Ellis | CPU Architecture: | Any |
[25 Nov 2004 15:15]
d di
[6 Dec 2004 19:54]
MySQL Verification Team
Thank you for the bug report.
[20 Dec 2004 13:24]
d di
The source line that causes the delay is in libmysql.c in the function create_named_pipe(...). The function makes one call to CreateFile that takes ~25 seconds in the described environment. Source code: =========== if ((hPipe = CreateFile(pipe_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL )) != INVALID_HANDLE_VALUE) break; ===================
[20 Dec 2004 13:33]
d di
FYI: The pipe name is "\\<server-ip>\pipe\MySQL". The return code from CreateFile is -1. Proposed solution: The error in my opinion is that MyODBC (libmysql, really) wrongly assumes that since the client is running on Windows (__WIN__), the server must also be [running on Windows] and thus it is a good idea to try to use Windows named pipes. Another big mistake, IMHO, is that create_named_pipe(...) assumes that CreateFile is instantaneous and thus does not take connection timeout into account when it connects using named pipes. The problem is a lot easier to reproduce on 3.51.09 than 3.51.10, we're still trying to figure out why.
[22 Dec 2004 13:18]
d di
Found a workaround. Install Samba on the server and allow it through the firewall or disable the firewall. The clients running on Windows now gets an immediate answer that there is no such named pipe available and drops further connection attempts, eliminating the remaining 3-6 seconds of connection delay.
[27 Jan 2005 15:22]
d di
We've found out that I've been seeing two distinct, unrelated delay problems. The connection delay that stems from the named pipe problem (CreateFile) only occurs on version 3.51.9, it is a different delay problem I'm seeing on 3.51.10. Thus all comments on this bug regarding the Named Pipes problem (all up till now) only regards MyODBC version 3.51.9. 3.51.10 had been installed on all machines that exhibited the delay, and all machines had been restarted endlessly. However the MyODBC DLL had apparently not been replaced on some of the machines. There seems to be a bug in the installer, but I'm not going to pursue this any further. (I'll just double-check the DLL version after restarting next time ;-)). The remaining delay problem I'm seeing with 3.51.10 has to do with Windows and not MyODBC. Please close this bug :-)
[28 Jan 2005 6:36]
Dean Ellis
Closing; noting that the ability to specify the named pipe to use (or to not specify one), made available by 3.51.10, resolves the delay that was occuring in earlier releases.