Add error threshold - better explanation #314
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I know you closed the previous request, but I feel like I did not explain the reason I had to implement this which hopefully justifies the complexity. In my case the lack of this feature caused a production level outage.
When you have multiple cache calls in a request, both timeouts and ignore exceptions are set and redis becomes unavailable, the request hangs until all the timeouts resolve. Through multiple requests, each with multiple cache hits (such as someone spamming refresh) this can ended up hanging the whole server.
I want ignore_exceptions to allow the cache to function as if there was no data returned on error, but still allow for occasional network stutters by having a timeout set to nonzero.
The thresholding I suggest allows you to fail fast when you have a redis outtage and prevent hanging.
If you have suggestions to reduce complexity and solve the issue I'd find that useful. I have been using my fork in prod since October.
P.S. Thanks for all the work on this, its really a great lib and great documentation.