From:             
Operating system: all
PHP version:      5.4.0
Package:          FPM related
Bug Type:         Bug
Bug description:Module shutdown only executed for parent process

Description:
------------
When a php-fpm child process shuts down it does not call module shutdown.

Check out sapi/fpm/fpm/fpm_main.c line 1917 in out:

    if (parent) {
        php_module_shutdown(TSRMLS_C);
        sapi_shutdown();
    }

I'm pretty sure this should be 

    php_module_shutdown(TSRMLS_C);
    if (parent) {
        sapi_shutdown();
    }

This caused us problems in our custom PHP extension because we need to
clean up 
when a child exits, closing 
sockets and freeing resources.

Thanks.

Patch attached

patch sapi/fpm/fpm/fpm_main.c fpm_child_mshutdown.patch


-- 
Edit bug report at https://bugs.php.net/bug.php?id=61231&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=61231&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=61231&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=61231&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=61231&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61231&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=61231&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=61231&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=61231&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=61231&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=61231&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=61231&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=61231&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=61231&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=61231&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=61231&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61231&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=61231&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=61231&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=61231&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=61231&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=61231&r=mysqlcfg

Reply via email to