#39330 [Opn->Asn]: apache2handler does not call shutdown actions before apache child die
| From: | tony2001@php.net | Date: | Wed, 08 Nov 2006 14:38:02 +0000 |
| Subject: | #39330 [Opn->Asn]: apache2handler does not call shutdown actions before apache child die | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-104601@lists.php.net to get a copy of this message | ||
ID: 39330
Updated by: tony2001@php.net
Reported By: isk at ecommerce dot com
-Status: Open
+Status: Assigned
Bug Type: Apache2 related
Operating System: Linux
PHP Version: 5.1.6
-Assigned To:
+Assigned To: iliaa
Previous Comments:
------------------------------------------------------------------------
[2006-11-01 13:16:08] isk at ecommerce dot com
Description:
------------
apache2handler sapi registers cleanup functions only for
main apache process.
php_apache_server_startup(){
...
apr_pool_cleanup_register(pconf, NULL,
php_apache_server_shutdown, apr_pool_cleanup_null);
...
}
The pconf is main apache process pool. But apache 2 cleans
_only_ child pool before it die.
apache2handler must register cleanup function and for
child pool. This can be fixed by several strings.
sapi/apache2handler/sapi_apache2.c:
static void php_apache_child_init(apr_pool_t *pchild,
server_rec *s)
{
apr_pool_cleanup_register(pchild, NULL,
php_apache_server_shutdown, apr_pool_cleanup_null);
}
void php_ap2_register_hook(apr_pool_t *p)
{
...
ap_hook_child_init(php_apache_child_init, NULL, NULL,
APR_HOOK_MIDDLE);
}
Without this code the using persistent connection has
problem in unclean close connection to DB after apache
child die.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39330&edit=1