Bug #52249 [Fbk->Opn]: Connection not closed on thrown exception, E_ERROR
| From: | dinumarina at gmail dot com | Date: | Mon, 05 Jul 2010 09:39:35 +0000 |
| Subject: | Bug #52249 [Fbk->Opn]: Connection not closed on thrown exception, E_ERROR | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-152095@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52249&edit=1
ID: 52249
User updated by: dinumarina at gmail dot com
Reported by: dinumarina at gmail dot com
Summary: Connection not closed on thrown exception, E_ERROR
-Status: Feedback
+Status: Open
Type: Bug
Package: MySQLi related
Operating System: CentOs
PHP Version: Irrelevant
New Comment:
Hi,
Do you expect it will fix it or just for test? I'm really pressed with
time.
Previous Comments:
------------------------------------------------------------------------
[2010-07-05 10:18:18] johannes@php.net
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2010-07-05 09:47:18] dinumarina at gmail dot com
Description:
------------
PHP version is 5.1.6 I haven't had the chance to run on newer versions
but I suspect it's a persistent structural bug; What happens is MySQLi
connection is not closed when script ends if it terminates due to a
raised exception or an E_ERROR. This causes a number of problems from
filling connection pool (mild) to blocking transactions (severe). The
connection is never closed until reset by mysql server. For exceptions,
there is the workaround of manually closing the connection in a default
exception handler, but for E_ERROR I couldn't find any closing protocol.
If this has been fixed in the later releases please be so kind to ignore
this. However I suspect otherwise since I could find no discussions
related to this. At the moment I don't have time to test with another
release.
Test script:
---------------
mysqli_connect($db_host,$db_user,$db_password);
throw new Exception();
Expected result:
----------------
When a script terminates (especially when crashed) all resources should
be freed: all open handles, tcp connections, etc. I realize there is a
problem with persistent connection handling, but a way should be found
to clean up the mess; otherwise one script can trash the whole server by
blocking transactions.
Actual result:
--------------
Connection lingers.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52249&edit=1