-
Notifications
You must be signed in to change notification settings - Fork 40
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
Disable caching when redis is down #26
Comments
I've been thinking about this a bit for the past couple of days. There are numerous ways to hack/monkey patch Readthis to operate if Redis goes down, but that is far from ideal. Really this should be a first-class feature of the library (for fetch/write type operations at least). I'll keep you informed as this is worked on. |
Thank you very much. I implemented a monkey patch recommended for redis-store. But it would be really nice to have a proper implementation. |
@dmitrypol Would you mind taking a look at #30? |
Hi Parker Thank you very much for implementing this fix. I pointed my Gemfile to commit fed72c7. In local dev I simply shutdown redis and it worked great. In production I did several things to test this. When I changed redis connection string I got this exception: getaddrinfo: Name or service not known. I think that's reasonable. But when I removed AWS Security Group firewall port 6379 and flushed keys in redis DB I would sometimes get: Looking at your PR I see rescue Redis::BaseConnectionError => error. But the error message I got above feels like CommandError. Could that be impacted by the fault_tolerant flag? Thanks, |
@dmitrypol From the redis errors file it looks like |
@dmitrypol I pushed a change to the fault tolerance branch, would you mind checking again? That's about as loose as I can make the error handling. |
Wow, talk about a fast response. Yes, I see your change and I agree that going to Redis::BaseError is looser but can present additional risks. I will deploy this fix to our prod and let you know how it goes tomorrow. |
No issues so far in prod. Thank you again for implementing the fix and for writing your blog. Lots of great ideas. |
Awesome, thanks for the thorough testing! I'm going to merge the PR then. |
I am using readthis for Rails caching with shared ElasticCache Redis instance in AWS. I'd like to be able to serve uncached content if Redis goes down (better slow site than dead one).
Any suggestions on how to do it?
The text was updated successfully, but these errors were encountered: