Skip to content

Commit

Permalink
Adding ResourceScope to ResourceExhaustedFailure (#382)
Browse files Browse the repository at this point in the history
**What changed?**
Adding a new field ResourceScope in ResourceExhaustedFailure.

**Why?**
We need to differentiate whether a request has been rate limited because of namespace limit or system limit. 
This will help us better understand why requests are rate limited and which limits to adjust.

**Breaking changes**
No

**Server PR**
temporalio/temporal#5605

Co-authored-by: Chad Retz <[email protected]>
  • Loading branch information
prathyushpv and cretz authored Mar 27, 2024
1 parent ce56299 commit 0a9dcf0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions temporal/api/enums/v1/failed_cause.proto
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,12 @@ enum ResourceExhaustedCause {
// Caller exceeds action per second limit.
RESOURCE_EXHAUSTED_CAUSE_APS_LIMIT = 6;
}

enum ResourceExhaustedScope {
RESOURCE_EXHAUSTED_SCOPE_UNSPECIFIED = 0;
// Exhausted resource is a system-level resource.
RESOURCE_EXHAUSTED_SCOPE_NAMESPACE = 1;
// Exhausted resource is a namespace-level resource.
RESOURCE_EXHAUSTED_SCOPE_SYSTEM = 2;
}

1 change: 1 addition & 0 deletions temporal/api/errordetails/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ message PermissionDeniedFailure {

message ResourceExhaustedFailure {
temporal.api.enums.v1.ResourceExhaustedCause cause = 1;
temporal.api.enums.v1.ResourceExhaustedScope scope = 2;
}

message SystemWorkflowFailure {
Expand Down

0 comments on commit 0a9dcf0

Please sign in to comment.