-
Notifications
You must be signed in to change notification settings - Fork 337
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
Add fault-tolerance for cache system errors #577
Open
johnnyshields
wants to merge
10
commits into
rack:main
Choose a base branch
from
tablecheck:system-hardening
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Mar 20, 2022
-
This PR adds several features and changes to error handling:
- Catch and handle all errors once per request. - Remove the `rescuing` blocks from the store proxies; rescuing per-method (read, write, increment) is bad because (a) it may result in undefined behavior, and (b) it will trigger repeated connection timeouts if your cache is down, e.g. N * M * timeout latency where N is the number of Rack::Attack metrics and M is the cache requests per metric. - Add `Rack::Attack.ignored_errors` config. This defaults to Dalli::DalliError and Redis::BaseError. - Add `Rack::Attack.failure_cooldown` config. This temporarily disables Rack::Attack after an error occurs (including ignored errors), to prevent cache connection latency. The default is 60 seconds. - Add `Rack::Attack.error_handler` which takes a Proc for custom error handling. It's probably not needed but there may be esoteric use cases for it. You can also use the shortcut symbols :block, :throttle, and :allow to respond to errors using those. - Add `Rack::Attack.calling?` method which uses Thread.current (or RequestStore, if available) to indicate that Rack::Attack code is executing. The reason for this is to add custom error handlers in the Rails Cache, i.e. "raise the error if it occurred while Rack::Attack was executing, so that Rack::Attack and handle it." Refer to readme. - Add "Fault Tolerance & Error Handling" section to Readme which includes all of the above.
Configuration menu - View commit details
-
Copy full SHA for ae9d7fd - Browse repository at this point
Copy the full SHA ae9d7fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for d3853e8 - Browse repository at this point
Copy the full SHA d3853e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 78c0939 - Browse repository at this point
Copy the full SHA 78c0939View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6af71d3 - Browse repository at this point
Copy the full SHA 6af71d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 59d5619 - Browse repository at this point
Copy the full SHA 59d5619View commit details
Commits on Jun 24, 2022
-
- Use request.env rather than separate env parameter
- Improvements to readme
Configuration menu - View commit details
-
Copy full SHA for 9cb7822 - Browse repository at this point
Copy the full SHA 9cb7822View commit details
Commits on Aug 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 63a8651 - Browse repository at this point
Copy the full SHA 63a8651View commit details
Commits on Aug 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 958ebe1 - Browse repository at this point
Copy the full SHA 958ebe1View commit details
Commits on Nov 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 4ff0da1 - Browse repository at this point
Copy the full SHA 4ff0da1View commit details
Commits on Nov 16, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2791b9d - Browse repository at this point
Copy the full SHA 2791b9dView commit details
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.