Skip to content

Commit ad612cc

Browse files
author
Mikhail Galanin
committed
Check if restart is pending before trying to lock SHM
This reduces lock contention when Opcache restart is scheduled but not yet started.
1 parent 4077dad commit ad612cc

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)