Hello,
First of all Phalcon is a great framework.
I'm having the problem that database connections are not closed when the request ends. DB Backend is PostgreSQL and PGPool II beforehand. I'm using php-fpm too, so there is a resource leak with open DB connections. Also when e.g. PGPool is restarted dangling and not useable useable connections are kept. Therefore all request before the reconnect fail (e.g. when pgpool oder postgrs is restarted).
I verified it with a new super class that close is not called (see below).
MyPostgresql::__construct()
MyPostgresql::connect()
According to the docs it should be closed on the end of the request: https://docs.phalcon.io/en/latest/api/Phalcon_Db_Adapter_Pdo_Postgresql.html
public close () inherited from Phalcon\Db\Adapter\Pdo Closes the active connection returning success. Phalcon automatically closes and destroys active connections when the request ends
Version is latest stable from git repo.
Any help would be fine, if it is a bug would be great if you could fix it.
Thnx.
Ciao,
Gerhard
class MyPostgresql extends Postgresql {
/**
* Creates the Adapter
*/
public function __construct(array $descriptor)
{
error_log("MyPostgresql::__construct()");
parent::__construct($descriptor);
}
/**
* Connect
*/
public function connect($descriptor=null)
{
error_log("MyPostgresql::connect()");
return parent::connect($descriptor);
}
/**
* Close
*/
public function close()
{
error_log("MyPostgresql::close()");
return parent::close();
}
}