Bug #68360 [NEW]: PDO PgSQL doesn't disconnect as expected

From: Date: Thu, 06 Nov 2014 07:05:24 +0000
Subject: Bug #68360 [NEW]: PDO PgSQL doesn't disconnect as expected
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188481@lists.php.net to get a copy of this message
From:             ianbytchek at gmail dot com
Operating system: OS X 10.10
PHP version:      5.6.2
Package:          PDO PgSQL
Bug Type:         Bug
Bug description:PDO PgSQL doesn't disconnect as expected

Description:
------------
The comment http://php.net/manual/en/pdo.connections.php#114822
makes a
very valid point. When we use the suggested method of dropping the
connection by doing 

$pdo = null;

The connection doesn't get dropped as described in the documentation. I
stumbled across this issue when running a few hundred PHPUnit tests,
which resulted in PostgreSQL running out of available connections after
150's test. I migrated from MySQL recently, which didn't have that
problem. The default number of available connections is 150 for both
systems.

The workaround is to use gc_collect_cycles() after unsetting the $pdo.
However, the disconnection should happen immediately after unsetting the
variable, not when the GC gets invoked.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=68360&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=68360&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=68360&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=68360&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=68360&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=68360&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=68360&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=68360&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=68360&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=68360&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=68360&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=68360&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=68360&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=68360&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68360&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=68360&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=68360&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=68360&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68360&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=68360&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=68360&r=mysqlcfg



Thread (5 messages)

« previous php.bugs (#188481) next »