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
Misleading warning (?) cache.WARNING: Failed to save key "mystringtags" of type integer. #34962
Comments
I'm not able to reproduce the warning. When an item is not found, invalidating it doesn't trigger the warning unless the tag cannot we written (invalidating writes to the pool). Status: needs feedback |
I've just got reports that the cache is not invalidating properly. I'm afraid that the tags are indeed not saved. Possibly the warning is correct, although I've yet to find out why the cache entries are written correctly, but the tag cache entries are not. Perhaps one of the caches is not able to process the Perhaps the bug description is wrong, but it's a bug in saving tags instead. I'll try to further debug this later this week. |
I've found the issue. Using a cache chain with tags is not a good idea without using a cache_pool The problem is that the tags are stored in the different levels of the cache chain and when invalidating tags, the tags might not even exist in the specific part of the cache we are looking in. Even when we clear it for that specific cache (ex. invalidate a tag within apcu), it is not invalidated in Redis too. When I introduced a cache_pool for the tags, all was ok.
Perhaps it's a good idea to either introduce an error message when trying to configure a cache pool with |
Your findings are correct! |
Yes, but I'm not very familiar with the DI Passes and stuff. Could you give me a hint what is the best place to throw an exception. Basically I want to throw an exception if someone tries to configure a cache pool with multiple adapters and tags: true (not a tags cache pool) Also that might be construed as a breaking change.. since it might pop up for people who have not noticed this bug and are using a chained adapter with tags this way. In my opinion the error would help them resolve a bug in their code, but not sure how you stand on the BC break on that. Alternatively I could look at contributing to the docs, never tried that either :) |
@rbaarsma I could look into it but I am not sure if I really understand what was the initial issue here. Can you elaborate bit on that? |
Can you please confirm the patch on |
…nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [Cache] skip APCu in chains when the backend is disabled | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34962 | License | MIT | Doc PR | - I think this should do it. Commits ------- 5a72084 [Cache] skip APCu in chains when the backend is disabled
Symfony version(s) affected: 4.4.1
Description
I see this warning in the logs:
The real problem is probably (?) that I'm trying to invalidateTags where the tag does not exist, but the warning message is not even close to telling me that.
How to reproduce
I'm using both doctrine ORM and doctrine ODM, and re-using the doctrine ORM cache pool to store ODM result cache manually
At some point I invalidate tags, but it is possible that the tag has not been created
That's when this message shows up.
Interestingly enough I get 4 warnings, two for each tag. Perhaps the tag was in redis, but not in this pod?
Possible Solution
Improved warning message that I've tried to invalidate a tag that does not exist.
The text was updated successfully, but these errors were encountered: