[Cache] fix warming up cache.system and apcu#30331
[Cache] fix warming up cache.system and apcu#30331nicolas-grekas merged 1 commit intosymfony:4.2from
Conversation
0564302 to
70b6994
Compare
| { | ||
| if (null === self::$apcuSupported) { | ||
| self::$apcuSupported = ApcuAdapter::isSupported(); | ||
| $opcache = new PhpFilesAdapter($namespace, $defaultLifetime, $directory, true); |
There was a problem hiding this comment.
no PhpFilesAdapter::isSupported(); falling back to FilesystemAdapter?
There was a problem hiding this comment.
Nope, unconditional is simpler and we don't care if you don't have opcache :)
There was a problem hiding this comment.
but, if the user does not have opcache or apcu, then you get no caching at all? possible hard to debug? up to the user to manually configure?
There was a problem hiding this comment.
just looked at it does sort of fallback to filesystem in 4.1 FYI
symfony/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php
Lines 89 to 123 in a57ce22
There was a problem hiding this comment.
if you don't have opcache, you don't care about that
There was a problem hiding this comment.
no opcache means you will still have the cache - but php will parse the files all the time
|
Maybe related? #29877 |
dkarlovi
left a comment
There was a problem hiding this comment.
Confirming this fix brings back my test suite runtime from 4.2 amount (9:25) back to 4.1 amount (4:10).
Since it's a regression, a test is probably required to avoid having it reappear?
|
I don't think a test case would have prevented the change - I would have changed the tests at the time actually. |
| @@ -108,16 +108,12 @@ function ($deferred, $namespace, &$expiredIds) use ($getId) { | |||
| */ | |||
| public static function createSystemCache($namespace, $defaultLifetime, $version, $directory, LoggerInterface $logger = null) | |||
There was a problem hiding this comment.
Returns an ApcuAdapter if supported, a PhpFilesAdapter otherwise.
Does not seem to be precise anymore.
|
I meant adding a test would prevent a future regression. Also, this doesn't seem to fix #29877 since that issue is due to incorrectly detecting APCu in CLI. |
70b6994 to
b0a85ad
Compare
This PR was merged into the 4.2 branch. Discussion ---------- [Cache] fix warming up cache.system and apcu | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29601, #29877 | License | MIT | Doc PR | - Commits ------- b0a85ad [Cache] fix warming up cache.system and apcu
Uh oh!
There was an error while loading. Please reload this page.