Bug #62571 [Opn]: Postgres PDO connections fail after SIGCHLD called
Edit report at https://bugs.php.net/bug.php?id=62571&edit=1
ID: 62571
User updated by: spiros_ioannou at yahoo dot gr
Reported by: spiros_ioannou at yahoo dot gr
Summary: Postgres PDO connections fail after SIGCHLD called
Status: Open
Type: Bug
Package: PDO related
Operating System: Linux
PHP Version: 5.3.14
Block user comment: N
Private report: N
New Comment:
When using persistent connections, even if reopening a new connection *after* forking, the
connection fails. The only way to have DB connections is to reopen them after forking, with
PDO::ATTR_PERSISTENT => false
Previous Comments:
------------------------------------------------------------------------
[2012-07-16 00:12:14] spiros_ioannou at yahoo dot gr
I revoke the statement of SIGCHLD, it happens even without the handler in some situations, the
behaviour seems erratic. Perhaps the database connection is shared with the children, and when the
child dies the db variable the connection is closed.
I tried closing the DB connection first thing on the child but with no results, the error still
appears when the child dies.
------------------------------------------------------------------------
[2012-07-15 23:27:50] spiros_ioannou at yahoo dot gr
Description:
------------
When using pcntl_fork to fork children, and *only* the parent uses the Postgres PDO database
connection, the connection becomes unusable after the first child exits and the signal handler is
called. If SIGCHLD signal handler is omitted PDO works normally for parent. Tested with and without
persistent connections.
Possible relevant bugs: 48447, 45797
Actual result:
--------------
PHP Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 7 server closed the
connection unexpectedly
This probably means the server terminated abnormally
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62571&edit=1
Thread (7 messages)