Skip to content

Commit edd6c6b

Browse files
authored
Add blob and memo limits to NamespaceInfo (#670)
## Describe what has changed in this PR Add `blob_size_limit_error` and `memo_size_limit_error` to NamespaceInfo ## Tell your future self why have you made these changes `blob_size_limit_error` is the maximum size in bytes for payload fields in workflow history events (e.g., workflow/activity inputs and results, failure details, signal payloads). When exceeded, the server will reject the operation with an error. `memo_size_limit_error` is the maximum total memo size in bytes per workflow execution. Today, the size limit for input payloads is enforced on the server. SDK doesn't have a reliable way to know whether the request will be rejected on the server, because the size of the fields in the request exceeds namespace-level configured `blob_size_limit_error` and `memo_size_limit_error`. The motivation here, is for SDK to be able to do the check, failing the workflow task, allowing the user to fix the failure, rather than terminating the workflow on the server. ## Are there any breaking changes on binary or code level? No ## If this breaks the Server, please provide the Server PR to merge right after this PR was merged. N/A
1 parent 94708bf commit edd6c6b

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

openapi/openapiv2.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7590,6 +7590,21 @@
75907590
},
75917591
"title": "A subset of WorkerDeploymentInfo"
75927592
},
7593+
"NamespaceInfoLimits": {
7594+
"type": "object",
7595+
"properties": {
7596+
"blobSizeLimitError": {
7597+
"type": "string",
7598+
"format": "int64",
7599+
"description": "Maximum size in bytes for payload fields in workflow history events\n(e.g., workflow/activity inputs and results, failure details, signal payloads).\nWhen exceeded, the server will reject the operation with an error."
7600+
},
7601+
"memoSizeLimitError": {
7602+
"type": "string",
7603+
"format": "int64",
7604+
"description": "Maximum total memo size in bytes per workflow execution."
7605+
}
7606+
}
7607+
},
75937608
"OperatorServiceUpdateNexusEndpointBody": {
75947609
"type": "object",
75957610
"properties": {
@@ -12549,6 +12564,10 @@
1254912564
"$ref": "#/definitions/v1NamespaceInfoCapabilities",
1255012565
"description": "All capabilities the namespace supports."
1255112566
},
12567+
"limits": {
12568+
"$ref": "#/definitions/NamespaceInfoLimits",
12569+
"title": "Namespace configured limits"
12570+
},
1255212571
"supportsSchedules": {
1255312572
"type": "boolean",
1255412573
"description": "Whether scheduled workflows are supported on this namespace. This is only needed\ntemporarily while the feature is experimental, so we can give it a high tag."

openapi/openapiv3.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9311,6 +9311,10 @@ components:
93119311
allOf:
93129312
- $ref: '#/components/schemas/NamespaceInfo_Capabilities'
93139313
description: All capabilities the namespace supports.
9314+
limits:
9315+
allOf:
9316+
- $ref: '#/components/schemas/NamespaceInfo_Limits'
9317+
description: Namespace configured limits
93149318
supportsSchedules:
93159319
type: boolean
93169320
description: |-
@@ -9335,6 +9339,18 @@ components:
93359339
type: boolean
93369340
description: True if the namespace supports reported problems search attribute
93379341
description: Namespace capability details. Should contain what features are enabled in a namespace.
9342+
NamespaceInfo_Limits:
9343+
type: object
9344+
properties:
9345+
blobSizeLimitError:
9346+
type: string
9347+
description: |-
9348+
Maximum size in bytes for payload fields in workflow history events
9349+
(e.g., workflow/activity inputs and results, failure details, signal payloads).
9350+
When exceeded, the server will reject the operation with an error.
9351+
memoSizeLimitError:
9352+
type: string
9353+
description: Maximum total memo size in bytes per workflow execution.
93389354
NamespaceReplicationConfig:
93399355
type: object
93409356
properties:

temporal/api/namespace/v1/message.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ message NamespaceInfo {
4040
bool reported_problems_search_attribute = 5;
4141
}
4242

43+
// Namespace configured limits
44+
Limits limits = 8;
45+
message Limits {
46+
// Maximum size in bytes for payload fields in workflow history events
47+
// (e.g., workflow/activity inputs and results, failure details, signal payloads).
48+
// When exceeded, the server will reject the operation with an error.
49+
int64 blob_size_limit_error = 1;
50+
// Maximum total memo size in bytes per workflow execution.
51+
int64 memo_size_limit_error = 2;
52+
}
53+
4354
// Whether scheduled workflows are supported on this namespace. This is only needed
4455
// temporarily while the feature is experimental, so we can give it a high tag.
4556
bool supports_schedules = 100;

0 commit comments

Comments
 (0)