Bug #81113 [Com]: PDO holds some non-GCable reference

From: Date: Tue, 08 Jun 2021 12:31:53 +0000
Subject: Bug #81113 [Com]: PDO holds some non-GCable reference
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234257@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81113&edit=1 ID: 81113 Comment by: m at m dot cz Reported by: m at m dot cz Summary: PDO holds some non-GCable reference Status: Open Type: Bug Package: PDO related Operating System: any PHP Version: 8.0.7 Block user comment: N Private report: N New Comment: It seems it is related with: https://github.com/doctrine/dbal/issues/3047 and https://bugs.php.net/bug.php?id=75190 which describes a GC issue when PDO class is extended, hovewer, it is marked as "not a bug". Why it is not a bug or is it technically impossible to provide full GC support? Previous Comments: ------------------------------------------------------------------------ [2021-06-08 11:52:05] nikic@php.net Okay, I think this will need some more reduced code to make progress. PDO generally does support GC, and since PHP 8.1 also supports per-driver GC. So this probably requires that some specific feature is being used. ------------------------------------------------------------------------ [2021-06-08 09:31:44] m at m dot cz At least pdo_mysql is affected, as when max. connection count is limited (by ALTER USER user@% WITH MAX_USER_CONNECTIONS 10;), connection limit is hit. ------------------------------------------------------------------------ [2021-06-08 08:52:19] nikic@php.net Which PDO driver do you use? ------------------------------------------------------------------------ [2021-06-08 08:46:32] m at m dot cz working link https://github.com/atk4/data/commit/83345e3ce4b9006efe9bfe50befacef20f3aee08 ------------------------------------------------------------------------ [2021-06-08 08:42:14] m at m dot cz Description: ------------ See https://github.com/atk4/data/pull/878/commits/83345e3ce4b9006efe9bfe50befacef20f3aee08 When DBAL connection is closed manually - all references to PDO connection are removed manually (by https://github.com/doctrine/dbal/blob/3.1.0/src/Connection.php#L646 ) - then PDO connection is released correctly. But when there is no reference to an object holding the PDO connection (in this case Doctrine\DBAL\Connection), PDO connection is NOT released when GC is run. I belive PDO holds some reference which is not decreased during GC cycle. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81113&edit=1

« previous php.bugs (#234257) next »