Skip to content

[Cache] Fix using a ChainAdapter as an adapter for a pool #60594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

IndraGunawan
Copy link
Contributor

@IndraGunawan IndraGunawan commented May 30, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #60579
License MIT

How to reproduce

symfony new --webapp --version lts 6.4
# services.yaml
services:
    _defaults:
        autowire: true 
        autoconfigure: true
    my_cache.chain:
        class: Symfony\Component\Cache\Adapter\ChainAdapter
        arguments:
            - [ '@cache.adapter.array', '@cache.adapter.filesystem' ]
        tags:
            - { name: cache.pool, namespace: 'my-custom-ns' }
# cache.yaml
framework:
    cache:
        pools:
            my_chain_pool:
                adapter: my_cache.chain

The error:

failing tests: https://github.com/symfony/symfony/actions/runs/15363463181/job/43233401667?pr=60594

!!  In Definition.php line 295:
!!                                                                                 
!!    The argument "0" doesn't exist in class "Symfony\Component\Cache\Adapter\ChainAdapter".  

@carsonbot carsonbot added this to the 6.4 milestone May 30, 2025
@IndraGunawan IndraGunawan changed the title ChainAdapter with custom namespace [Cache] ChainAdapter with custom namespace May 30, 2025
@IndraGunawan IndraGunawan marked this pull request as draft May 30, 2025 08:01
@IndraGunawan IndraGunawan force-pushed the chain-adapter-custom-ns branch from bfb0f18 to 73605bb Compare May 30, 2025 08:58
@IndraGunawan IndraGunawan marked this pull request as ready for review May 30, 2025 09:02
@IndraGunawan IndraGunawan force-pushed the chain-adapter-custom-ns branch from 73605bb to 5c8f906 Compare May 31, 2025 09:44
@xabbuh

This comment was marked as outdated.

@IndraGunawan IndraGunawan force-pushed the chain-adapter-custom-ns branch from 5c8f906 to ad4b87b Compare May 31, 2025 12:02
@IndraGunawan

This comment was marked as outdated.

@IndraGunawan
Copy link
Contributor Author

Status: ready for review

nicolas-grekas
nicolas-grekas previously approved these changes Jun 23, 2025
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jun 23, 2025

Ah sorry I missed the high/low-deps failures. The reason why this fails is because of the cross-packages deps.
Do you think you can find a test case that'd fit in CachePoolPassTest instead of FrameworkBundle?

@nicolas-grekas nicolas-grekas dismissed their stale review June 23, 2025 14:40

too quick, tests fail

@OskarStark OskarStark changed the title [Cache] ChainAdapter with custom namespace [Cache] ChainAdapter with custom namespace Jun 23, 2025
@IndraGunawan IndraGunawan force-pushed the chain-adapter-custom-ns branch from 8e3d149 to 7348993 Compare June 27, 2025 09:20
@IndraGunawan
Copy link
Contributor Author

@nicolas-grekas i can't reproduce the error with Cache component alone without FrameworkBundle

the issue occurs when

services:
    _defaults:
        autoconfigure: true

if the autoconfigure: false even without this patch, no error occurs. so i'm not sure if the issue is in the CachePoolPass or another place

I'd be grateful if you could assist me with this issue

@nicolas-grekas nicolas-grekas changed the title [Cache] ChainAdapter with custom namespace [Cache] Fix using a ChainAdapter as an adapter for another ChainAdapter Jun 27, 2025
@nicolas-grekas nicolas-grekas changed the title [Cache] Fix using a ChainAdapter as an adapter for another ChainAdapter [Cache] Fix using a ChainAdapter as an adapter for a pool Jun 27, 2025
@nicolas-grekas nicolas-grekas force-pushed the chain-adapter-custom-ns branch from 7348993 to b24e3cd Compare June 27, 2025 18:31
@nicolas-grekas
Copy link
Member

Thank you @IndraGunawan.

@nicolas-grekas nicolas-grekas merged commit 53c18cf into symfony:6.4 Jun 27, 2025
11 checks passed
@IndraGunawan
Copy link
Contributor Author

Thank you @nicolas-grekas

This was referenced Jun 28, 2025
@fabpot fabpot mentioned this pull request Jun 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
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