Add a flow quota manager and throttling - #3219
Open
gbrodman wants to merge 1 commit into
Open
Conversation
This uses the already-existing quota manager to acquire quota, if necessary, before running a flow. If we can't acquire quota, we throw a command use EPP exception. Note: this is unused so far, as you can see from the FlowQuotaModule (we provide an empty list of flow classes to throttle). This is intentionally done to limit the scope of the commit. We inject the flow-quota-parameters classes because we wish to throttle requests before any possible transaction is started -- for transactional flows, we start the transaction before actually instantiating the flow class.
Member
|
This design might suffer from YAGNI? Do we really need such an abstracted implementation for our one use case? |
Collaborator
Author
We haven't discussed this in person, but I was thinking back to that time when we had a ton of domain deletion requests coming through in bunches; this could theoretically be beneficial there too (and not just creates). But primarily yeah, it just seemed messy to have like, hard-coded checks for domain creations during the FlowRunner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This uses the already-existing quota manager to acquire quota, if necessary, before running a flow. If we can't acquire quota, we throw a command use EPP exception.
Note: this is unused so far, as you can see from the FlowQuotaModule (we provide an empty list of flow classes to throttle). This is intentionally done to limit the scope of the commit.
We inject the flow-quota-parameters classes because we wish to throttle requests before any possible transaction is started -- for transactional flows, we start the transaction before actually instantiating the flow class.
This change is