Skip to content

Commit 305a844

Browse files
Mikhail Galaninbon
Mikhail Galanin
authored and
bon
committed
Check if restart is pending before trying to lock SHM
This reduces lock contention when Opcache restart is scheduled but not yet started. Closes phpGH-11805
1 parent e2d2e3b commit 305a844

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/opcache/zend_file_cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,6 +1868,7 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handl
18681868

18691869
if (!file_cache_only &&
18701870
!ZCSG(restart_in_progress) &&
1871+
!ZCSG(restart_pending) &&
18711872
!ZSMMG(memory_exhausted) &&
18721873
accelerator_shm_read_lock() == SUCCESS) {
18731874
/* exclusive lock */

0 commit comments

Comments
 (0)