-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
Gracefully fail when Redis commands fail #461
Comments
@danielvonmitschke: That's exactly what Object Cache Pro does. However this plugin would need quite a bit of work done to accomplish that. We're always open to a pull request if you like to contribute this. |
Thank you. Unfortunately the pro version is out of our price range. |
Yeah, it's certainly a high end product. It looks like non of the FOSS plugins do graceful return values. |
My mind boggles to see that this plugin has option "WP_REDIS_GRACEFUL" parameter to bypass 500 error when redis not available, yet developer hasn't added this option in plugin settings by default. Why the sites of naive users should appear broken and face alot of panic when 500 error appear for visitors (which may last for hours when go unnoticed) What OP has asked is very basic behavior of any reasonable caching plugin offers. Actually this is the prime feature of every cache solution. to use fallback if cache not available or service unavailable. |
What an ignorant comment... When the mind is boggled, it's wise to ask questions. For example:
You get excellent answers like:
Furthermore, if you'd like a better |
Hi,
I am using redis-cache on a plesk server with a bitnami/redis docker container.
In my log file I get quite a few fatal errors in the form of
Uncaught RedisException: read error on connection to 127.0.0.1:6379 in /var/www/vhosts/sites/www.web/app/object-cache.php:1897
.In your FAQ your write to just ignore there error and that would be total fine with me.
Unfortunately there is a "BUT":
I saw quite a few instances where this caused some basic wordpress or woocommerce "operations" to fail.
And in my opinion that should not be the case.
Here is what I mean with that:
We have some operation in wordpress or woocommerce that is trying to "do" something and in some place it uses caching or transients. Most of the time that would be just asking if there is some value in the cache and if not to do a costly calculation of this value.
But if there is a connection problem with redis this causes the whole operation to break.
Instead redis-cache should fail gracefully in this case and just behave as if the value wasn't present in the cache (e.g. return false or whatever the default value is for that).
This of course should be applied to all redis cache functions.
This way we wouldn't break any higher level operations just because the cache is not working for a split second.
Please let me know what you think.
Best,
daniel
The text was updated successfully, but these errors were encountered: