Opcache prevents file from being added to realpath cache?
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.1k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
Description
realpath cache is a per process cache
opcache is a shared cache
opcache is enabled with validation 2 seconds
foo.php contains:
<?php $t = time();
bar.php contains:
$path = '../foo.php';
require_once $path;
echo $t;
var_dump( realpath_cache_get() );
with php-fpm request bar.php multiple times.
when checking realpath_cache_get() we see foo.php is added to the realpath cache
as soon as opcache has cached this require once foo.php, foo.php is removed from realpath cache - for most worker processes.
Questions:
-
opcache seems to be able to clear the realpath cache for some (?) workers - how is opcache able to do that? or does this happen on every request separately? (how come that foo.php is still in realpath cache for some workers though?)
-
no matter what (
is_file,realpath,...) calls with../foo.phpwill never make it populate realpath cache again with this file, once it's in opcache - even when calling clearstatcache before it because the file is potentially deleted beforehand. It always seems to fetch the full path again from disk instead of storing it in realpath?
PHP Version
8.3
Operating System
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riprodurre il comportamento con foo.php e bar.php sotto php-fpm, usando require_once, realpath_cache_get(), is_file(), realpath() e clearstatcache(), con la convalida di opcache abilitata. Confrontare i risultati tra i processi worker e tracciare l’interazione tra opcache e realpath-cache; il lavoro è completo quando vengono spiegati i diversi contenuti della cache e il mancato ripopolamento della cache, oppure viene identificato un fix confermato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, php
- Ambito
- backend, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 30/100