Add generated payload limit validator - #3056
Open
jmaeagle99 wants to merge 1 commit into
Open
Conversation
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.
What was changed
Add a build-time generator and a runtime validator to
temporal-serviceclient.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.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
How was this tested: Unit tests
Any docs updates needed? No