Repository navigation
Return termination details from getResult - #3242
Open
pcbeingused33 wants to merge 2 commits into
Open
pcbeingused33 wants to merge 2 commits into
pcbeingused33 wants to merge 2 commits into
Conversation
WorkflowStub.terminate already encodes details with the workflow data converter, but getResult built TerminatedFailure from the reason alone. Pass the close-event details through that same converter, including a payload codec and external payload storage.
| * @param reason optional reason for the termination request | ||
| * @param details additional details about the termination reason | ||
| * @param details additional details about the termination request. {@code getResult} exposes them | ||
| * on {@link TerminatedFailure#getDetails()} |
Contributor
There was a problem hiding this comment.
this comment doesn't add any value, you already have docs on getDetails on TerminatedFailure
This branch has not been deployed
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.
WorkflowStub.terminatestores its details on the workflow termination event, encoded with the workflow data converter.WorkflowStub.getResultbuiltTerminatedFailurefrom the reason only, so those details were discarded. Cancellation already returns its details throughEncodedValuesand that same converter.TerminatedFailurenow carries the details, the same wayCanceledFailuredoes.getResultreads them from the termination event and decodes them with the workflow converter. That converter is the workflow one even when a Nexus handler started the workflow and the server propagated a different context for the result. Terminate without details still leavesgetDetails()empty.TerminatedFailureInfohas no details field, so failure protobuf conversion is unchanged.There is no breaking change:
TerminatedFailure(String, Throwable)stays as it is. No server change is required.TerminatedWorkflowDetailsTestterminates a workflow with a detail large enough to be offloaded, through a prefix payload codec. Before this change that test did not compile, becauseTerminatedFailurehad nogetDetails(). With the change,./gradlew --offline :temporal-sdk:test --tests io.temporal.workflow.TerminatedWorkflowDetailsTest --tests io.temporal.workflow.TerminatedWorkflowTestpasses: the original detail and reason come back, the storage driver records a store and a retrieve, and terminate without details still yields an empty list.spotlessApplycompleted as well.AI assistance was used to prepare this change.