[packages/php/PHP_7_4] opcache: abandon forced restart on EPERM instead of faking a kill

arekm arekm at pld-linux.org
Tue Sep 1 23:47:22 CEST 2026


commit 2c3883948cb5df1c365777af718fc81b591a09e4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Sep 1 22:50:23 2026 +0200

    opcache: abandon forced restart on EPERM instead of faking a kill
    
    Faking success left the locker holding the lock, so the F_GETLK loop never
    exited and froze the whole instance under the SHM lock.

 opcache-nokill-perm.patch | 35 +++++++++++++++++++++++++----------
 php.spec                  |  2 +-
 2 files changed, 26 insertions(+), 11 deletions(-)
---
diff --git a/php.spec b/php.spec
index 442877e..0b949a4 100644
--- a/php.spec
+++ b/php.spec
@@ -150,7 +150,7 @@ Summary(ru.UTF-8):	PHP Версии 7 - язык препроцессирова
 Summary(uk.UTF-8):	PHP Версії 7 - мова препроцесування HTML-файлів, виконувана на сервері
 Name:		%{orgname}%{php_suffix}
 Version:	7.4.33
-Release:	15
+Release:	16
 Epoch:		4
 # All files licensed under PHP version 3.01, except
 # Zend is licensed under Zend
diff --git a/opcache-nokill-perm.patch b/opcache-nokill-perm.patch
index a064b79..99f5f3c 100644
--- a/opcache-nokill-perm.patch
+++ b/opcache-nokill-perm.patch
@@ -1,15 +1,30 @@
---- php-7.4.33/ext/opcache/ZendAccelerator.c~	2022-10-31 11:36:06.000000000 +0100
-+++ php-7.4.33/ext/opcache/ZendAccelerator.c	2024-03-20 11:15:28.896613056 +0100
-@@ -797,7 +797,11 @@ static inline void kill_all_lockers(stru
+--- php-7.4.33/ext/opcache/ZendAccelerator.c~	2026-09-01 22:34:41.000000000 +0200
++++ php-7.4.33/ext/opcache/ZendAccelerator.c	2026-09-01 22:34:41.000000000 +0200
+@@ -787,6 +787,13 @@ static inline void kill_all_lockers(stru
+ 					/* Process died before the signal was sent */
+ 					success = 1;
+ 					zend_accel_error(ACCEL_LOG_WARNING, "Process %d died before SIGKILL was sent", mem_usage_check->l_pid);
++				} else if (errno == EPERM) {
++					/* We are not permitted to signal this locker, so it can never be
++					   killed here. Abandon the forced restart instead of spinning on a
++					   lock we cannot release; back off by another timeout. */
++					zend_accel_error(ACCEL_LOG_WARNING, "No permission to kill locker %d, abandoning forced restart", mem_usage_check->l_pid);
++					ZCSG(force_restart_time) = time(NULL) + ZCG(accel_directives).force_restart_timeout;
++					return;
+ 				}
+ 				break;
+ 			}
+@@ -797,6 +804,13 @@ static inline void kill_all_lockers(stru
  					/* successfully killed locker, process no longer exists  */
  					success = 1;
  					zend_accel_error(ACCEL_LOG_WARNING, "Killed locker %d", mem_usage_check->l_pid);
--				}
-+                                } else if (errno == EPERM) {
-+                                        /* we have no permission to kill the other process, so no point in trying */
-+                                        success = 1;
-+                                        zend_accel_error(ACCEL_LOG_WARNING, "No permission to kill Process %d", mem_usage_check->l_pid);
-+                                }
++				} else if (errno == EPERM) {
++					/* We are not permitted to signal this locker, so it can never be
++					   killed here. Abandon the forced restart instead of spinning on a
++					   lock we cannot release; back off by another timeout. */
++					zend_accel_error(ACCEL_LOG_WARNING, "No permission to kill locker %d, abandoning forced restart", mem_usage_check->l_pid);
++					ZCSG(force_restart_time) = time(NULL) + ZCG(accel_directives).force_restart_timeout;
++					return;
+ 				}
  				break;
  			}
- 			usleep(10000);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/2c3883948cb5df1c365777af718fc81b591a09e4



More information about the pld-cvs-commit mailing list