[4.0 P2] T-32 Cache layer robustness
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- php
- Ambito
- performance
Direzione di ricerca
Start in src/Instrument/ClassLoading/CachePathManager.php: loadCacheState() at :346-347, the merge loop at :347-368, and the null-cacheDir write at :397 reached by clearCacheState() at :412. Then read src/Instrument/ClassLoading/AopComposerLoader.php:160-164 and src/Instrument/Transformer/WeavingTransformer.php:970-983 for the class-map and function-proxy freshness paths. Run the existing cache path manager tests first. Done means unit tests for a merge after a concurrent write, a missing class-map file, and flushCacheState(true) without a cacheDir.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Part of #665 · Priority: P2 · BC window: no · References are path:line at a5a1504.
Problem
The metadata cache loses entries under concurrency, trusts files that may be missing, can write to the filesystem root, and never forgets deleted sources.
Evidence
src/Instrument/ClassLoading/CachePathManager.php:346-347:loadCacheState()is a no-op once the state is loaded, soflushCacheState()merges into the snapshot taken at the start of the request and overwrites entries that other processes wrote in the meantime.src/Instrument/ClassLoading/AopComposerLoader.php:160-164trusts the class map (added to Composer at:96-98). A missing cached file leads to a failed include instead of re-weaving.src/Instrument/Transformer/WeavingTransformer.php:970-972: function-proxy freshness ignores everything except the file's existence. The content depends on the namespace, the advisors and PHP's internal function list, so a PHP upgrade serves stale proxies. The write at:980-983is also non-atomic (T-05).src/Instrument/ClassLoading/CachePathManager.php:343:|| $forceletsflushCacheState(true)run with a null cacheDir, so:397writes to/_transformation.cache.clearCacheState()(:412) triggers this.src/Instrument/ClassLoading/CachePathManager.php:347-368: entries for deleted sources are never pruned.
Failure scenario
Two concurrent cold requests both flush. The second writes its own snapshot plus its new entries, and the first request's entries are lost, so those classes re-weave on the next request.
Proposed fix
- Re-read the file under an exclusive lock just before merging, then write through
CacheFileWriter. - In production, check
is_fileon a class-map hit (cheap with the stat cache) and fall back to the loader. - Key function proxies by
PHP_VERSION_IDplus the advisor hash. - Return early when cacheDir is null.
- Prune entries whose source is gone during warmup.
Acceptance
- Unit tests covering: a merge after a concurrent write, a missing class-map file, and
flushCacheState(true)without a cacheDir.
Related
T-05, T-21.
- Lingua principale
- PHP
- Stelle
- 1.7k
- Fork
- 166
- Merge medio
- 9h 24m
- PR unite (30g)
- 29
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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.
Altre issue di goaop/framework
-
Enhancement Performance
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Enhancement Performance
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
-
Enhancement Performance To Be Discussed
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Enhancement Performance
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Enhancement Performance
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di goaop/framework
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
customer-support needs-triage Platform(Default)
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
grokability/snipe-it#19767 ·
I maintainer di solito rispondono entro 1 giorno
-
[Code Quality] SfxDownloader extract path has no destination-writability pre-check for cached zipsApertapriority:low type:refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
crazy-goat/workerman-bundle#1052 ·
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno