Skip to content

Add generated payload limit validator - #3056

Open
jmaeagle99 wants to merge 1 commit into
mainfrom
payload-limits
Open

Add generated payload limit validator#3056
jmaeagle99 wants to merge 1 commit into
mainfrom
payload-limits

Conversation

@jmaeagle99

Copy link
Copy Markdown
Contributor

What was changed

Add a build-time generator and a runtime validator to temporal-serviceclient.

  • The generator reads the Temporal API descriptors and writes GeneratedPayloadLimitValidator.java. That file holds one method for each message that can hold a payload. Each method reports the size of the payload and memo fields in that message. Hand-written tables in the generator give a class to every such field: blob, memo, blob with a warning only, or no check. The build fails if a field has no class, and also if a class no longer matches a field.
  • The validator takes an outbound request. It measures each payload and memo field in the same way as the server. It compares each size against a warning limit and an error limit. It returns the first error and gives the proto path of the field, for example commands[2].schedule_activity_task_command_attributes.input.

No code calls the validator yet. A later change connects it to the gRPC channel.

Why?

Server limits payload and memo sizes and fails executions that have too-large payloads. These changes allow the SDK to find those oversized payloads and, in future change, choose a different behavior such as proactive failing the task retryably.

The Rust core uses a similar design to automatically detect payload changes in the Temporal API proto messages and forces a decision on how those fields are classified.

Checklist

  1. How was this tested: Unit tests

  2. Any docs updates needed? No

@jmaeagle99
jmaeagle99 requested a review from a team as a code owner September 4, 2026 15:12
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.

1 participant