Skip to content

Add a flow quota manager and throttling - #3219

Open
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:throttledFlow
Open

Add a flow quota manager and throttling#3219
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:throttledFlow

Conversation

@gbrodman

@gbrodman gbrodman commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

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 Reviewable

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.
@CydeWeys

Copy link
Copy Markdown
Member

This design might suffer from YAGNI? Do we really need such an abstracted implementation for our one use case?

@gbrodman

Copy link
Copy Markdown
Collaborator Author

This design might suffer from YAGNI? Do we really need such an abstracted implementation for our one use case?

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

*
* <p>Note: the registrar ID may be empty if we're not authenticated yet, like a LoginFlow.
*/
String getQuotaId(EppInput eppInput, String registrarId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants