Bug #17581: mysql_connect hangs Apache

From: Date: Mon, 03 Jun 2002 17:52:24 +0000
Subject: Bug #17581: mysql_connect hangs Apache
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9365@lists.php.net to get a copy of this message
From: hermannj@slu.edu Operating system: Tru64 Unix PHP version: 4.1.2 PHP Bug Type: Apache related Bug description: mysql_connect hangs Apache Apache child processes hang when: 1. A PHP script (let's call it connect.php) sends a mysql_connect request to a MySQL server. 2. The MySQL server is powered down - completely shut off. Example of connect.php: <?php mysql_connect("db","user","pass") || or die("OMG!"); ?> ps ax | grep httpd | wc shows 14 httpd processes After calling http://www.domain.com/connect.php with a browser ps ax | grep httpd | wc shows 15 httpd processes Hitting stop on the browser has no affect. 15 processes remain. After calling /apache/bin/ap -n 200 -c 200 http://www.domain.com/connect.php This will call the script 200 times concurrently. ps ax | grep httpd | wc shows 152 httpd processes (MaxClients reached) Now going to http://www.domain.com/ produces nothing but a timeout. Since there is no mysql_connect timeout, the Apache processe hang indefinately. Result: server hosed! This is much too fragile. Gracefuly restarting Apache has no affect since it is waiting for the child processes to complete. You must stop Apache and start Apache to resume operations. Environment: Tru64 Unix PHP 4.1.2 MySQL builtin libraries -- Edit bug report at http://bugs.php.net/?id=17581&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17581&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17581&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17581&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17581&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17581&r=support Expected behavior: http://bugs.php.net/fix.php?id=17581&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17581&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17581&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17581&r=globals

« previous php.bugs (#9365) next »