Skip to content
Permalink
Browse files

bug #32363 [FrameworkBundle] reset cache pools between requests (nico…

…las-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] reset cache pools between requests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Looks like we missed this part: cache pools should all be reset between requests, at least to persist any deferred items. Replaces #32361 (which should be applied when merging 3.4 into 4.2).

Commits
-------

5ff45ba [FrameworkBundle] reset cache pools between requests
  • Loading branch information...
nicolas-grekas committed Jul 4, 2019
2 parents db05791 + 5ff45ba commit a383649ad79296deab9f03daa63ba40b70f53da4
@@ -8,7 +8,7 @@
<defaults public="false" />

<service id="cache.app" parent="cache.adapter.filesystem" public="true">
<tag name="cache.pool" clearer="cache.app_clearer" reset="reset" />
<tag name="cache.pool" clearer="cache.app_clearer" />
</service>

<service id="cache.system" parent="cache.adapter.system" public="true">
@@ -29,7 +29,7 @@

<service id="cache.adapter.system" class="Symfony\Component\Cache\Adapter\AdapterInterface" abstract="true">
<factory class="Symfony\Component\Cache\Adapter\AbstractAdapter" method="createSystemCache" />
<tag name="cache.pool" clearer="cache.system_clearer" />
<tag name="cache.pool" clearer="cache.system_clearer" reset="reset" />
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- namespace -->
<argument>0</argument> <!-- default lifetime -->
@@ -39,7 +39,7 @@
</service>

<service id="cache.adapter.apcu" class="Symfony\Component\Cache\Adapter\ApcuAdapter" abstract="true">
<tag name="cache.pool" clearer="cache.default_clearer" />
<tag name="cache.pool" clearer="cache.default_clearer" reset="reset" />
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- namespace -->
<argument>0</argument> <!-- default lifetime -->
@@ -50,7 +50,7 @@
</service>

<service id="cache.adapter.doctrine" class="Symfony\Component\Cache\Adapter\DoctrineAdapter" abstract="true">
<tag name="cache.pool" provider="cache.default_doctrine_provider" clearer="cache.default_clearer" />
<tag name="cache.pool" provider="cache.default_doctrine_provider" clearer="cache.default_clearer" reset="reset" />
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- Doctrine provider service -->
<argument /> <!-- namespace -->
@@ -61,7 +61,7 @@
</service>

<service id="cache.adapter.filesystem" class="Symfony\Component\Cache\Adapter\FilesystemAdapter" abstract="true">
<tag name="cache.pool" clearer="cache.default_clearer" />
<tag name="cache.pool" clearer="cache.default_clearer" reset="reset" />
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- namespace -->
<argument>0</argument> <!-- default lifetime -->
@@ -72,14 +72,14 @@
</service>

<service id="cache.adapter.psr6" class="Symfony\Component\Cache\Adapter\ProxyAdapter" abstract="true">
<tag name="cache.pool" provider="cache.default_psr6_provider" clearer="cache.default_clearer" />
<tag name="cache.pool" provider="cache.default_psr6_provider" clearer="cache.default_clearer" reset="reset" />
<argument /> <!-- PSR-6 provider service -->
<argument /> <!-- namespace -->
<argument>0</argument> <!-- default lifetime -->
</service>

<service id="cache.adapter.redis" class="Symfony\Component\Cache\Adapter\RedisAdapter" abstract="true">
<tag name="cache.pool" provider="cache.default_redis_provider" clearer="cache.default_clearer" />
<tag name="cache.pool" provider="cache.default_redis_provider" clearer="cache.default_clearer" reset="reset" />
<tag name="monolog.logger" channel="cache" />
<argument /> <!-- Redis connection service -->
<argument /> <!-- namespace -->
@@ -19,7 +19,6 @@
use Symfony\Component\Cache\Adapter\AdapterInterface;
use Symfony\Component\Cache\Adapter\ApcuAdapter;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\Adapter\ChainAdapter;
use Symfony\Component\Cache\Adapter\DoctrineAdapter;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Adapter\ProxyAdapter;
@@ -1244,10 +1243,6 @@ private function assertCachePoolServiceDefinitionIsCreated(ContainerBuilder $con
$this->assertSame(DoctrineAdapter::class, $parentDefinition->getClass());
break;
case 'cache.app':
if (ChainAdapter::class === $parentDefinition->getClass()) {
break;
}
// no break
case 'cache.adapter.filesystem':
$this->assertSame(FilesystemAdapter::class, $parentDefinition->getClass());
break;

0 comments on commit a383649

Please sign in to comment.
You can’t perform that action at this time.