Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@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