-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 5.1.2
How to reproduce
$ APP_DEBUG=0 bin/console cache:pool:clear cache.app
// "SCAN" "0" "COUNT" "1000" "MATCH" "wu1MerR6oe:*" (redis-cli monitor)
$ APP_DEBUG=1 bin/console cache:pool:clear cache.app
// "SCAN" "0" "COUNT" "1000" "MATCH" "nonmBNxiVY:*" (redis-cli monitor)
Possible Solution
We can see below that the namespace keys is generated from the class name of the cache adapter.
$name = $tags[0]['name'] ?? $id; | |
if (!isset($tags[0]['namespace'])) { | |
$namespaceSeed = $seed; | |
if (null !== $class) { | |
$namespaceSeed .= '.'.$class; | |
} | |
$tags[0]['namespace'] = $this->getNamespace($namespaceSeed, $name); |
In the CacheCollectorPass, this class can be decorated by a TraceableAdapter in debug mode. Once decoracted, the namespace changes.
symfony/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
Lines 164 to 168 in 49eafee
if ($container->getParameter('kernel.debug')) { | |
$container->addCompilerPass(new AddDebugLogProcessorPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 2); | |
$container->addCompilerPass(new UnusedTagsPass(), PassConfig::TYPE_AFTER_REMOVING); | |
$container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_BEFORE_REMOVING, -255); | |
$container->addCompilerPass(new CacheCollectorPass(), PassConfig::TYPE_BEFORE_REMOVING); |