Bug #7634 Updated: mysql_pconnect() + lock tables can hang server

From: Date: Wed, 21 Nov 2001 03:05:29 +0000
Subject: Bug #7634 Updated: mysql_pconnect() + lock tables can hang server
References: 1  Groups: php.dev php.doc 
Request: Send a blank email to php-dev+get-71166@lists.php.net to get a copy of this message
ID: 7634 Updated by: torben Reported By: torben@php.net Old Status: Open Status: Closed Old Bug Type: MySQL related Bug Type: Documentation problem Operating System: Mandrake 7.0 PHP Version: 4.0 Latest CVS (03/11/2000) New Comment: Closed as a Doc problem; added a warning in CVS about the issue. Also included some info regarding transactions behaving similarly from the user notes. Previous Comments: ------------------------------------------------------------------------ [2001-11-20 20:10:51] torben@php.net Nope, still happens. This is on Debian woody, PHP 4.1.0RC3 (haven't tried on the win32 version you posted a link to, but whatever). Same script. ------------------------------------------------------------------------ [2001-11-20 19:46:00] mfischer@php.net Can you try latest RC and see if the problem persists http://phpuk.org/~james/php-4.1.0RC3-win32.zip Feedback. ------------------------------------------------------------------------ [2000-11-03 21:08:24] torben@php.net I've heard about this from a couple of sources and been looking for answers, but haven't found anything definitive. I don't even know if it's solvable. However, when using persistent connections and LOCK TABLES, if for any reason the UNLOCK TABLES never gets executed, the server ends up hanging while it waits for the lock to get released. This is reproduceable for me on every version of PHP I've tried. Example script: <?php /* -*- mode: c++; minor-mode: font -*- */ error_reporting(E_ALL); $dbh = mysql_pconnect($host, $user, $pass); /* Just to test the connection. */ if ($res = mysql_db_query($db, 'show tables', $dbh)) { while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) { echo $row["Tables_in_$db"] . "<br>\n"; } } echo "<hr>\n"; $table = 'category'; echo "Locking table '$table' (if the script blocks here, then the lock never got released)...<br>\n"; flush(); if ($res = mysql_db_query('chaps', "lock tables $table write", $dbh)) { echo "OK; locked.<br>\n"; } else { echo "failed; could not lock.<br>\n"; } flush(); //$res = mysql_db_query('chaps', "unlock tables", $dbh) ?> Is this just me? ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=7634&edit=1

« previous php.dev (#71166) next »