PHP 8.2 FPM Leaks processes on pcntl_fork
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu với reproducer index.php Drupal 10 được cung cấp, đặc biệt là lệnh gọi pcntl_fork() và hành vi của các tiến trình PHP-FPM. Tái hiện vấn đề này với PHP 8.2.10 trên Ubuntu 16.04 và so sánh với PHP 7.4. Hoàn thành khi các tiến trình được fork được dọn dẹp sau sleep thay vì tách ra và tiếp tục tồn tại dưới tiến trình master của FPM.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
OS: xenial
PHP tested: 8.2.7, 8.2.10
The following drupal 10 index.php:
<?php
/**
* @file
* The PHP page that serves all page requests on a Drupal installation.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
*/
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
$autoloader = require_once 'autoload.php';
$kernel = new DrupalKernel('prod', $autoloader);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$pid = pcntl_fork();
if ( $pid !== 0 ) {
// we are the parent process
return;
}
sleep(10);
$kernel->terminate($request, $response);
After doing ~5 requests to the site, results in the following sub-processes to the FPM master:
root 15873 0.0 0.8 464188 17200 ? Ss 13:08 0:00 php-fpm: master process (/var/www/site-fpm/drush12test.prod/php-fpm-8.2.conf)
drush12+ 16518 0.7 1.4 466300 29860 ? S 13:11 0:00 \_ php-fpm: pool drush12test
drush12+ 16557 0.0 0.6 466300 13068 ? S 13:11 0:00 \_ php-fpm: pool drush12test
drush12+ 16559 0.0 0.6 466300 12640 ? S 13:11 0:00 \_ php-fpm: pool drush12test
drush12+ 16561 0.0 0.6 466300 12640 ? S 13:11 0:00 \_ php-fpm: pool drush12test
drush12+ 16563 0.0 0.6 466300 12640 ? S 13:11 0:00 \_ php-fpm: pool drush12test
But then after a few seconds, when it should clean them up, they will instead detach and linger around:
root 15873 0.0 0.8 464188 17188 ? Ss 13:08 0:00 php-fpm: master process (/var/www/site-fpm/drush12test.prod/php-fpm-8.2.conf)
drush12+ 16557 0.0 1.1 464252 23364 ? S 13:11 0:00 php-fpm: pool drush12test
drush12+ 16559 0.0 1.1 464252 23028 ? S 13:11 0:00 php-fpm: pool drush12test
drush12+ 16561 0.0 1.1 464252 23028 ? S 13:11 0:00 php-fpm: pool drush12test
drush12+ 16563 0.0 1.1 466300 23432 ? S 13:11 0:00 php-fpm: pool drush12test
The same doesn't happen with PHP 7.4. In that case the processes get cleaned up properly.
PHP Version
PHP 8.2.10
Operating System
Ubuntu 16.04
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.2k
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 103
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của php/php-src
-
Bug SAPI: cli_server Status: Verified
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Bug Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Bug Status: Needs Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Bug Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Flaky hrtime.phpt test Đang mởBug Category: Tests Status: Verified
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
HarbourMasters/Shipwright#7229 ·
-
Error while building from source Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 bình luận ·