Re: MySQL clients hang when network to server is disrupted!
On Wed, 20 Mar 2002 16:00:15 -0800 Lance Welsh [EMAIL PROTECTED] wrote: It is a big problem for us, and I can only imagine for anyone using MySQL, when a mysql client hangs on an established connection to the mysql server because the network to the server is disrupted (such as someone pulling power to a network hub or many other scenarios). We have changed the source code to fix this, but I'd sure like to hear comments from people that know MySQL. The mysql client can respond with an error if the server dies or is shutdown because the network will cleanup the broken connection. The mysql client can also respond with an error if the server is not available for a connection. But if the connection is already established and the network connection is disrupted, the client simply hangs. Someone please tell me if I am wrong, or if I am doing something wrong. Perhaps there is a feature or option I am overlooking (the option to set a timeout when connecting does not affect existing connections). Perhaps my change here could be incorporated into the source code control if someone will guide me. What we have done to get around this problem is to use poll with a timeout before blindly hanging on a read. I had to alter the vio_read method in the violite.c file: Hi! In some cases you can have a connection to timeout by setting network read and write timeouts on the server. For all other cases, network read and write timeouts will have to be established on the client side too. -- Regards, -- For technical support contracts, go to https://order.mysql.com/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, FullTime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: MySQL Clients Hang
--On Saturday, February 02, 2002 2:16 AM -0600 Ed Carp [EMAIL PROTECTED] wrote: I have not completely figured out what the problem is and I never got a response from any one else on the list. I can tell you it looks like a mutex problem between two threads. We have followed it down into pthreads where it seems to be stuck. The external symptom we see is that the MySQL server does not open any of the databases. The really bad news is that it is not a MySQL problem so reinstalling MySQL does nothing to fix it. The worse news is that the MySQL server does not give you a clue what the problem is. We had a Linux guru look at the version of mysql on this system that we compiled with debug. I got information about the debugging session third hand and really don't have any details other than the problem appeared to be in pthreads. I am not so sure pthreads is at fault other than a dead-lock condition exists and it is not detecting it and blowing one of the stuck processes away. What version of Linux are you running? After a lot of reearch and gdb'ing, I found a bug report in bugzilla on redhat.com that seems to illustrate the bug that we're having: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=13785 In short, it seems it's a contention problem in pthread_lock. the fix is to upgrade to libc 2.1.92 (or better). RedHat 6.2 is running libpthreads 0.8, and I think this problem is fixed in 0.9. Unfortuantely, 0.9 needs libc 2.2, so you're probably better off upgrading to RedHat 7.2. I know, this bug report applies to SMP kernels, but ieven if you're not running an SMP kernel, it's probably a good idea to upgrade anyway. Why it started suddenly and won't go away, I have no idea. Thanks for keeping me informed. Two systems here exhibited the problem, both RedHat 6.1 systems, one a uniprocessor system, and one an SMP system. The kernel on the SMP system is 2.12.12-20smp. The other system has been rebuilt. The SMP system is soon to be rebuilt with RedHat 7.2 and a kernel that we build to make sure we are greater than 2.4.10. Bill +--- | Bill MacAllister | Senior Programmer, Pride Industries | 10030 Foothills Blvd., Roseville CA 95747 | Phone: +1 916.788.2402Fax: +1 916.788-2540 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: MySQL Clients Hang
I have not completely figured out what the problem is and I never got a response from any one else on the list. I can tell you it looks like a mutex problem between two threads. We have followed it down into pthreads where it seems to be stuck. The external symptom we see is that the MySQL server does not open any of the databases. The really bad news is that it is not a MySQL problem so reinstalling MySQL does nothing to fix it. The worse news is that the MySQL server does not give you a clue what the problem is. We had a Linux guru look at the version of mysql on this system that we compiled with debug. I got information about the debugging session third hand and really don't have any details other than the problem appeared to be in pthreads. I am not so sure pthreads is at fault other than a dead-lock condition exists and it is not detecting it and blowing one of the stuck processes away. What version of Linux are you running? After a lot of reearch and gdb'ing, I found a bug report in bugzilla on redhat.com that seems to illustrate the bug that we're having: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=13785 In short, it seems it's a contention problem in pthread_lock. the fix is to upgrade to libc 2.1.92 (or better). RedHat 6.2 is running libpthreads 0.8, and I think this problem is fixed in 0.9. Unfortuantely, 0.9 needs libc 2.2, so you're probably better off upgrading to RedHat 7.2. I know, this bug report applies to SMP kernels, but ieven if you're not running an SMP kernel, it's probably a good idea to upgrade anyway. Why it started suddenly and won't go away, I have no idea. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: MySQL Clients Hang
--On Tuesday, January 29, 2002 2:08 AM -0600 Ed Carp [EMAIL PROTECTED] wrote: What seems to be happening is that the open of the db hangs. So, when you attempt to connect with a client, mysql tries to look at the grant tables and hangs waiting for access. This is just a guess though. When you connect with a client, mysql_real_connect opens a socket to the server, does the handshaking, then authenticates and passes the query info. When I connect, I don't get anything, and gdb says the client is hung in one of the net_read routines, which makes sense - the client is waiting for something from the server. Yes, exactly. To authenticate you it has to consult the grant tables, i.e. the tables in the mysql db. It has to open those files. I never see the file opens. Is this a MySQL issue or not? I'm not sure - I just downloaded MySQL-3.23.47-1.i386.rpm and installed it (this is supposedly the static version of the server, no?) and it gave me exactly the same result, which if it was a Linux issue, it shouldn't react the same, since it was linked statically, so I'm leaning towards it being a MySQL issue of MySQL not handling an error condition properly. Yes, I think it is a mysql issue in that the mysql server does not respond. It is likely that in both of our situations something has changed in the environment to make the server go catatonic. I just can't figure out what it is and mysql is not helping me figure it out at all. No error message, no core, no nothing. Bill +--- | Bill MacAllister | Senior Programmer, Pride Industries | 10030 Foothills Blvd., Roseville CA 95747 | Phone: +1 916.788.2402Fax: +1 916.788-2540 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
re: MySQL Clients Hang
--On Monday, January 28, 2002 11:52:08 AM -0600 Ed Carp [EMAIL PROTECTED] wrote: Hi, Bill! Did you ever get this issue resolved? I've got the same problem - MySQL starts, but no clients can connect, not even mysqladmin. TIA :) I have not completely figured out what the problem is and I never got a response from any one else on the list. I can tell you it looks like a mutex problem between two threads. We have followed it down into pthreads where it seems to be stuck. The external symptom we see is that the MySQL server does not open any of the databases. The really bad news is that it is not a MySQL problem so reinstalling MySQL does nothing to fix it. The worse news is that the MySQL server does not give you a clue what the problem is. Bill + | Bill MacAllister, Senior Programmer | PRIDE Industries | 10030 Foothills Blvd, Dept 1150 | Roseville, CA 95747 | 916-788-2402 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: MySQL Clients Hang
What seems to be happening is that the open of the db hangs. So, when you attempt to connect with a client, mysql tries to look at the grant tables and hangs waiting for access. This is just a guess though. When you connect with a client, mysql_real_connect opens a socket to the server, does the handshaking, then authenticates and passes the query info. When I connect, I don't get anything, and gdb says the client is hung in one of the net_read routines, which makes sense - the client is waiting for something from the server. Is this a MySQL issue or not? I'm not sure - I just downloaded MySQL-3.23.47-1.i386.rpm and installed it (this is supposedly the static version of the server, no?) and it gave me exactly the same result, which if it was a Linux issue, it shouldn't react the same, since it was linked statically, so I'm leaning towards it being a MySQL issue of MySQL not handling an error condition properly. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php