[php-src] Issue #8072: php-fpm trying to kill another user's pool results in an infinite loop and 99% cpu usage

From: Date: Tue, 15 Feb 2022 23:04:15 +0000
Subject: [php-src] Issue #8072: php-fpm trying to kill another user's pool results in an infinite loop and 99% cpu usage
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239827@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8072 Comment Author: bukka I'm aware that there are issues with using opcache when there are pools with different user. I think an ideal solution would be to separate opcache shared memory for each pool but that might be a bit tricky and not probably applicable as a bug fix. That's something that could be potentially done in FPM by having some pool process manager that would do MINIT for each pool but that's not a small thing to do. Not sure if it can be currently handled by opcache as we would probably have to make it aware of all pools when allocating shared memory and then it would somehow need select the right one in child but that seems even more complicated and not probably optimal but I'm not really an expert on opcache so might be wrong. There might be some other things that could be potentially done to handle this specific case but think it might need to be done in opcache as I don't think the process kill comes from FPM but from opcache. FPM kills processes from master but not from the child (at least I can't remember any place where it would do so) so you would not likely see such error because master will be most likely root in your case. The specific place where I think this might be happening is here: https://github.com/php/php-src/blob/0e65e433a9a439b8249ee18c53b82ce06e25ad5f/ext/opcache/ZendAccelerator.c#L783-L844 . That's the only place where I see the kill and that function is called only on forced restart by the look at the code. Do you by any chance use opcache.force_restart_timeout directive? As I said I'm not really expert on opcache but @dstogov is so he might have some ideas how to potentially address this.

« previous php.bugs (#239827) next »