Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Cache] Unconditionally use PhpFilesAdapter for system pools#27549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
b2b40e4 to8cf36c7Comparepalex-fpt commentedJun 8, 2018
There is one problem with PhpFilesAdapter - it does not use opcache till next request. |
8cf36c7 to19c30c9Comparenicolas-grekas commentedJun 8, 2018
After having a deeper look, it does, but only if the file's mtime is in the past. This is now fixed. Thanks for the hint. |
palex-fpt commentedJun 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
to pass tests it should invalidate cache on file deletion (opcache_invalidate should be called before file is unlinked) |
19c30c9 todf6dddbComparenicolas-grekas commentedJun 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That would open race conditions (invalidating, then a concurrent request reloads the legacy file, then we write but this is ignored). |
df6dddb to647cfccComparenicolas-grekas commentedJun 8, 2018
Hum, dunno why but tests pass locally and not the CI. I added the call you suggested but still red. Any idea why? |
palex-fpt commentedJun 8, 2018
calls to $cache->delete() or $cache->clear() unlinks files. but opcache is still has file cached. And |
palex-fpt commentedJun 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
647cfcc to22bf5c3Comparenicolas-grekas commentedJun 8, 2018
Thanks, patch applied. |
palex-fpt commentedJun 8, 2018
opcache_invalidate should be called before unlink |
palex-fpt commentedJun 8, 2018
invalidate fails when file does not exits and opcache still contains file entry. |
d1f6da9 tocc1edabComparenicolas-grekas commentedJun 8, 2018
Thanks, now green! |
cc1edab toce1a15dCompare| { | ||
| $this->file =$file; | ||
| $this->pool =$fallbackPool; | ||
| $this->zendDetectUnicode =ini_get('zend.detect_unicode'); |
nicolas-grekasJun 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
No need to deal withzend.detect_unicode anymore whenthis line is removed. Let's remove the related complexity and overhead.
ce1a15d toc91b778Compare| * | ||
| * @return AdapterInterface | ||
| * | ||
| * @deprecated since Symfony 4.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
no dot at the end (I know, our conventions are hard to follow :)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
updated
c91b778 to51381e5Comparefabpot commentedJun 11, 2018
Thank you@nicolas-grekas. |
… pools (nicolas-grekas)This PR was merged into the 4.2-dev branch.Discussion----------[Cache] Unconditionally use PhpFilesAdapter for system pools| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Now that we're about to leverage OPCache shared memory even for objects (see#27543), there's no reason anymore to use APCu for system caches. Let's remove some complexity here.As a bonus, this makes system caches pruneable using the `cache:pool:prune` command.Commits-------51381e5 [Cache] Unconditionally use PhpFilesAdapter for system pools
| */ | ||
| publicstaticfunctioncreateSystemCache($namespace,$defaultLifetime,$version,$directory,LoggerInterface$logger =null) | ||
| { | ||
| @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.',__CLASS__),E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
shouldn't it be__METHOD__ ?
…sAdapter for system pools" (nicolas-grekas)This PR was merged into the 4.2-dev branch.Discussion----------Revert "feature#27549 [Cache] Unconditionally use PhpFilesAdapter for system pools"This reverts commitd4f5d46, reversingchanges made to7e3b7b0.| Q | A| ------------- | ---| Branch? | 4.2| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Reading#28800, I've just realized that#27549 breaks using system caches with read-only filesystem.Using ApcuAdapter makes system caches compatible with read-only filesystems.Note that this affects only non-warmed up pools, as the warmed-up ones use a faster `PhpArrayAdapter` in front.Commits-------dbc1230 Revert "feature#27549 [Cache] Unconditionally use PhpFilesAdapter for system pools (nicolas-grekas)"
Now that we're about to leverage OPCache shared memory even for objects (see#27543), there's no reason anymore to use APCu for system caches. Let's remove some complexity here.
As a bonus, this makes system caches pruneable using the
cache:pool:prunecommand.