-
Notifications
You must be signed in to change notification settings - Fork 346
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
\Cache::delete_all() using memcached driver not clearing all items #2143
Comments
I think you do. I've checked all drivers, and the apc and redis drivers contain the same code. My initial reaction, without testing, is that for these three the prefixing shouldn't be there at all, because they work with a cache index per cache_id, so a delete_all() without a I've checked the history, turns out this code has been there since it's creation by Dan in 2010, so it has never worked as intended. |
Correction, I think the cache_id shouldnt be there, so L149 should be
Are you able to check it, I don't have memcached handy at the moment... |
@WanWizard I will in a bit, in the middle of prepping a release myself. |
I suspect it's uncommon to want to call |
Ah, yes, an empty cache id would hide the bug... 😏 |
Ok, I think I've got something worked out. How do I add/run tests to fuel_core? |
Well, I got the included tests to run on my project that's using Fuel. I included them in the PR but haven't run them purely in the context of a clean FuelPHP environment. |
We'll probably have to remove them, a clean environment doesn't have any memcached config (or working backend), so those tests will always fail. |
I just ran into an issue where delete_all wasn't working as I expected.
The first argument to Cache::delete_all() is
$section
, with the following description:On fuel/core 1.8.2, I'm getting this behavior using the memcached driver:
Looking at https://github.com/fuel/core/blob/1.8.2/classes/cache/storage/memcached.php#L149
$section
is prepended with the configured cache_id.Then looking at https://github.com/fuel/core/blob/1.8.2/classes/cache/storage/memcached.php#L157
This is the branch for choosing between deleting everything or just the matching section - however,
! empty($section)
looks like it can't ever befalse
because it will always contain the prepended cache_id.Also note - it won't be an issue if
cache.memcached.cache_id
is an empty string.Just checking to see if I'm seeing this correctly?
The text was updated successfully, but these errors were encountered: