ID:               39330
 Updated by:       [EMAIL PROTECTED]
 Reported By:      isk at ecommerce dot com
 Status:           Assigned
 Bug Type:         Apache2 related
 Operating System: Linux
 PHP Version:      5.1.6
-Assigned To:      iliaa
+Assigned To:      tony2001
 New Comment:

I'll commit the patch after 5.2.3 release.


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

Reply via email to