Skip to content

Commit 570ead3

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 6b6a5cd commit 570ead3

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
@@ -1786,6 +1786,7 @@ zend_persistent_script *zend_file_cache_script_load(zend_file_handle *file_handl
17861786

17871787
if (!file_cache_only &&
17881788
!ZCSG(restart_in_progress) &&
1789+
!ZCSG(restart_pending) &&
17891790
!ZSMMG(memory_exhausted) &&
17901791
accelerator_shm_read_lock() == SUCCESS) {
17911792
/* exclusive lock */

0 commit comments

Comments
 (0)