Skip to content

[FrameworkBundle][Cache] cache:pool:list are missing pools #35030

@alex-dev

Description

@alex-dev

Symfony version(s) affected: 4.3 and up (#31021)

Description
Caches are not all reported by cache:pool:list. Ensuring there is at least two caches in separate clearers will trigger the bug.

Origin
Code from: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Cache/DependencyInjection/CachePoolPass.php
Out of context code has been removed to simplify my point.

$pools = [];
$clearers = [];

// Fill out $pools and $clearers;

foreach ($clearers as $id => $pools) {
    // $pools will be leaked out of the scope;
    // Hopefully unintended behavior;
}

if ($container->hasDefinition('console.command.cache_pool_list')) {
    $container->getDefinition('console.command.cache_pool_list')->replaceArgument(0, array_keys($pools));
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy