php-fpm trying to kill another user's pool results in an infinite loop and 99% cpu usage
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
Hi,
We've come across an interesting issue where an instance of the php-fpm pool ran by one user gets stuck restarting and tries to kill another user's php-fpm pool instances.. similar issue has been described here:
https://bugs.php.net/bug.php?id=74709
Can you please help us fix this? Here's a snippet of strace of the process in question:-
strace: Process 34545 attached
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
fcntl(3, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=32328}) = 0
kill(32328, SIGTERM) = -1 EPERM (Operation not permitted)
the process for which above strace is for is owned by user "xyz", while the process it's trying to kill (process id: 32328) is owned by user "anc".
I would also like to add that this causes all of our websites to timeout. by all websites i mean websites which are using the same php version. like for example the process that's currently stuck and reported in my below mssg is using php 8.0.15 and so all of the websites on my server using php 8.0.15 are timing out.
PHP Version
8.0.15
Operating System
CloudLinux v7.9.0 (CentOS 7)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Keine Quelldatei oder kein Test ist angegeben. Beginnen Sie damit, den Neustart des php-fpm-Pools unter PHP 8.0.15 auf CloudLinux v7.9/CentOS 7 zu reproduzieren, und untersuchen Sie die wiederholte kill- und file-lock-Sequenz, die von strace angezeigt wird. Als erledigt gilt die Aufgabe, wenn ein EPERM-Ergebnis keine Endlosschleife verursachen kann, die den Pool eines anderen Benutzers beeinträchtigt, und Websites, die dieselbe PHP-Version verwenden, weiterhin erreichbar bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- backend, operating-systems
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 30/100