Bug #70185 [Com]: php-fpm restarts master process in a loop when exec() and using ssh multiplexing

From: Date: Fri, 21 Jul 2017 09:36:49 +0000
Subject: Bug #70185 [Com]: php-fpm restarts master process in a loop when exec() and using ssh multiplexing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210161@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70185&edit=1 ID: 70185 Comment by: d dot reade at reades dot co dot uk Reported by: kobenews at cox dot net Summary: php-fpm restarts master process in a loop when exec() and using ssh multiplexing Status: Open Type: Bug Package: FPM related Operating System: CentOS release 6.6 (Final) PHP Version: 5.4.43 Block user comment: N Private report: N New Comment: I'm experiencing a very similar issue. My server is running CentOS 7.3, cPanel 64.0.33, Apache 2.4.27 and PHP 5.6.31 with PHP-FPM. After much investigation, the following script reproduces my issue: <?php exec('/usr/bin/postcss css_from.css --use autoprefixer --autoprefixer.remove "false" --output css_to.css'); echo 'Done'; ?> Only after the script completes does the PHP-FPM process then use 100% CPU and the PHP-FPM error.log file does this: root@l1vs09rcms [/opt/cpanel/ea-php56/root/usr/var/log/php-fpm]# head error.log -n 128 [21-Jul-2017 10:23:03] NOTICE: fpm is running, pid 30537 [21-Jul-2017 10:23:03] NOTICE: ready to handle connections [21-Jul-2017 10:23:03] NOTICE: systemd monitor interval set to 10000ms [21-Jul-2017 10:23:13] WARNING: [pool dev3_reades_local] child 30540 said into stderr: "✔ Finished css_from.css (60ms)" [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30540 exited with code 0 after 1.167822 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30551 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30551 exited with code 0 after 0.007451 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30552 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30552 exited with code 0 after 0.007069 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30553 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30553 exited with code 0 after 0.007391 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30554 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30554 exited with code 0 after 0.007211 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30555 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30555 exited with code 0 after 0.007631 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30556 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30556 exited with code 0 after 0.007972 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30558 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30558 exited with code 0 after 0.007635 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30559 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30559 exited with code 0 after 0.007761 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30560 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30560 exited with code 0 after 0.007557 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30561 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30561 exited with code 0 after 0.007735 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30562 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30562 exited with code 0 after 0.008361 seconds from start [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30563 started [21-Jul-2017 10:23:13] NOTICE: [pool dev3_reades_local] child 30563 exited with code 0 after 0.007477 seconds from start The log file is meant to rotate as per the cPanel configuration, but when it's doing this and constantly growing, the rotate threshold does not trigger the rotate and so the log file just keeps getting bigger until the server runs out of disk space and crashes! It doesn't even matter if I use shell_exec() or exec(), or if I append "> /dev/null 2>&1" to the command thinking the output is the cause. If I append the command so there's no output, the log file doesn't show the warning, but the continuous notices still happen regardless and so the log file just gets bigger. The workaround for us is to not execute any scripts that contain exec() or shell_exec() and to execute these scripts from the command line instead, which is doable as I wrote all our software, but for others using other pre-written software packages this could be a problem. Previous Comments: ------------------------------------------------------------------------ [2017-04-25 14:24:13] php at grindau dot com Well, "kobenews at cox dot net" asked for additional informations to reproduce. After that tons of input of me and others were provided but we havent got any feedback so far. I am not one of the devs, so i am not going to change any metadata of which i dont have enough knowledge. I ll leave this up to people who are into it and limit my input on providing feedback. ------------------------------------------------------------------------ [2017-04-25 14:04:17] merrill at oakland dot edu This bug does effect 7.x as well That being said, it's an open source project, with an insurmountable amount of bugs (That's just the way big projects work). Somebody who cares will have to work on it an try to submit a patch. ------------------------------------------------------------------------ [2017-04-25 11:35:58] spam2 at rhsoft dot net > This happens in the latest stable php 7.1 as well! > As everybody could have seen in my post with > the timestamp: 2017-03-10 20:03 UTC then someone should change this metadata PHP Version: 5.4.43 OS: CentOS release 6.6 (Final) ------------------------------------------------------------------------ [2017-04-25 11:28:55] php at grindau dot com As everybody could have seen in my post with the timestamp: 2017-03-10 20:03 UTC. ------------------------------------------------------------------------ [2017-04-25 10:24:23] php at grindau dot com This happens in the latest stable php 7.1 as well! ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=70185 -- Edit this bug report at https://bugs.php.net/bug.php?id=70185&edit=1

« previous php.bugs (#210161) next »