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

arekm arekm at pld-linux.org
Tue Sep 1 23:45:00 CEST 2026


commit 523fdfbafbd9240219c8f8391418dc6ec724d1b4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Sep 1 23:40:42 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 | 26 ++++++++++++++++----------
 php.spec                  |  2 +-
 2 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/php.spec b/php.spec
index d9a080a..eb97762 100644
--- a/php.spec
+++ b/php.spec
@@ -130,7 +130,7 @@
 %define		ver_suffix	86
 %define		php_suffix	%{!?with_default_php:%{ver_suffix}}
 %define		subver		beta2
-%define		rel		0.1
+%define		rel		0.2
 Summary:	PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):	Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):	Język skryptowy PHP
diff --git a/opcache-nokill-perm.patch b/opcache-nokill-perm.patch
index 0130461..fb52777 100644
--- a/opcache-nokill-perm.patch
+++ b/opcache-nokill-perm.patch
@@ -1,24 +1,30 @@
---- php-8.2.17/ext/opcache/ZendAccelerator.c~	2024-03-12 15:26:30.000000000 +0100
-+++ php-8.2.17/ext/opcache/ZendAccelerator.c	2024-03-20 11:45:08.979946189 +0100
-@@ -852,6 +852,10 @@ static inline void kill_all_lockers(stru
+--- php-8.6.0beta2/ext/opcache/ZendAccelerator.c~	2026-09-01 22:33:09.000000000 +0200
++++ php-8.6.0beta2/ext/opcache/ZendAccelerator.c	2026-09-01 22:33:09.000000000 +0200
+@@ -874,6 +874,13 @@ static inline void kill_all_lockers(stru
  					/* Process died before the signal was sent */
  					success = true;
  					zend_accel_error(ACCEL_LOG_WARNING, "Process %d died before SIGKILL was sent", mem_usage_check->l_pid);
 +				} else if (errno == EPERM) {
-+					/* We have no permission to kill the other process, so no point in trying */
-+					success = true;
-+					zend_accel_error(ACCEL_LOG_WARNING, "No permission to kill locker %d: %s. Assuming success.", mem_usage_check->l_pid, strerror(errno));
++					/* 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;
  				} else if (errno != 0) {
  					zend_accel_error(ACCEL_LOG_WARNING, "Failed to send SIGKILL to locker %d: %s", mem_usage_check->l_pid, strerror(errno));
  				}
-@@ -864,6 +868,10 @@ static inline void kill_all_lockers(stru
+@@ -886,6 +893,13 @@ static inline void kill_all_lockers(stru
  					/* successfully killed locker, process no longer exists  */
  					success = true;
  					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 = true;
-+					zend_accel_error(ACCEL_LOG_WARNING, "No permission to kill locker %d again: %s. Assuming success.", mem_usage_check->l_pid, strerror(errno));
++					/* 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;
  				} else if (errno != 0) {
  					zend_accel_error(ACCEL_LOG_WARNING, "Failed to check locker %d: %s", mem_usage_check->l_pid, strerror(errno));
  				}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/523fdfbafbd9240219c8f8391418dc6ec724d1b4



More information about the pld-cvs-commit mailing list