|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74778 opcache_clear() puts php-fpm master in a cpu loop
Submitted: 2017-06-19 08:35 UTC Modified: -
Avg. Score:3.5 ± 1.7
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: daniel dot ylitalo at mytaste dot com Assigned:
Status: Open Package: FPM related
PHP Version: 7.1.6 OS: FreeBSD 11.0-RELEASE-p10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-06-19 08:35 UTC] daniel dot ylitalo at mytaste dot com
I tried clearing a pools opcache with opcache_reset(); however while the script finishes running, once it completes the fpm-master process goes into some kind of loop using 50% cpu and the pools goes dormant and stops accepting connections

Nginx block:
location /opcache-clear {
        fastcgi_pass    unix:/var/run/php/pool-xyz-socket.sock;
        fastcgi_index   clear.php;
        fastcgi_param   PHP_ADMIN_VALUE "open_basedir=/home/www/";
        include         fastcgi_params;
        fastcgi_param   SCRIPT_NAME        /clear.php;
        fastcgi_param   SCRIPT_FILENAME    $document_root/clear.php;

FPM POOLS consists of this configuration with different listen.owners/users:

listen = /var/run/php/pool-xyz-socket.sock

listen.owner = xxxxxxxx = www
listen.mode = 0660

user = xx-xx
group = xx-xx

pm = static
pm.max_children = 20

pm.status_path = /fpm-status.php

Test script:

$status = opcache_reset();

if($status === true) {
    echo '+OK';
    echo '+ERROR';

Expected result:
The fpm-master process should not go into a cpu loop and continue serving requests

Actual result:
fpm sockets stops accepting connections


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 15 18:01:23 2021 UTC