Skip to content

fix: cache:pool:prune fatals on a traced cache pool#57

Merged
jstojiljkovic merged 3 commits into
tracewayapp:masterfrom
pflueg:fix/cache-pool-prune-delegation
Jun 26, 2026
Merged

fix: cache:pool:prune fatals on a traced cache pool#57
jstojiljkovic merged 3 commits into
tracewayapp:masterfrom
pflueg:fix/cache-pool-prune-delegation

Conversation

@pflueg

@pflueg pflueg commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

cache:pool:prune fails with a fatal error when cache tracing is enabled (the default) and a prunable pool is configured - typically a DB-backed app cache. Since the command is usually run on a schedule, it surfaces as a recurring failure of the cleanup job rather than an interactive error.

The cause: Symfony tags prunable pools, and when a pool is wrapped for tracing, that tag is transferred onto TraceableCachePool. Symfony's pruner then selects the decorator and calls prune() on it - a method the decorator did not implement, resulting in Call to undefined method ...TraceableCachePool::prune().

The fix follows Symfony's own TraceableAdapter: TraceableCachePool now implements PruneableInterface and delegates prune() to the wrapped pool, returning false when that pool is not prunable. The tag-aware and namespaced variants inherit the behaviour.

Two tests cover it - delegation to a prunable pool, and false for a non-prunable one. Full suite passes, PHPStan level 10 clean.

Fixes #56.

@pflueg pflueg changed the title fix: implement PruneableInterface on TraceableCachePool so cache:pool:prune works fix: cache:pool:prune fatals on a traced cache pool Jun 26, 2026
@jstojiljkovic
jstojiljkovic merged commit 6f0f348 into tracewayapp:master Jun 26, 2026
9 checks passed
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jstojiljkovic

Copy link
Copy Markdown
Collaborator

Thanks, @pflueg, excellent fix.
Merged, shipping in the next patch. 🙏

@pflueg

pflueg commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks alot - especially for your work @jstojiljkovic !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cache:pool:prune fatals: Call to undefined method TraceableCachePool::prune()

3 participants