-
Notifications
You must be signed in to change notification settings - Fork 192
Add summary to side effect and mutable side effect #2699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add summary to side effect and mutable side effect #2699
Conversation
yuandrew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor doc comments
temporal-sdk/src/main/java/io/temporal/internal/replay/ReplayWorkflowContext.java
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/statemachines/SideEffectStateMachine.java
Show resolved
Hide resolved
| .build(); | ||
| addCommand(StateMachineCommandUtils.createRecordMarker(markerAttributes)); | ||
| addCommand(StateMachineCommandUtils.createRecordMarker(markerAttributes, metadata)); | ||
| metadata = null; // only used once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding, why do we null after recording once? Is it because replay is the only time we'd re-create a marker, and we don't need this for replay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise we just hold the metadata in memory when we no longer need it, just a memory optimization.
17deb8b to
3b53ae0
Compare
3b53ae0 to
f0cafac
Compare
Add summary to side effect and mutable side effect.
closes #2702
Note
Add summary options to side/mutable side effects and plumb user metadata into marker/events across runtime, with API overloads and tests verifying metadata.
SideEffectOptionsandMutableSideEffectOptionswithsummarysupport.Workflow.sideEffect(..)andmutableSideEffect(..)(and outbound interceptor methods) to accept options.UserMetadatafor timers, side effects, mutable side effects, child workflows, local activities, and Nexus operations.UserMetadatathroughSideEffectStateMachineandMutableSideEffectStateMachine; attach toRECORD_MARKERcommands.StateMachineCommandUtils.createRecordMarkerto accept optional metadata; update callers.ReplayWorkflowContext,WorkflowStateMachines, andSyncWorkflowContext.HistoryUtils.assertEventMetadata.Written by Cursor Bugbot for commit f0cafac. This will update automatically on new commits. Configure here.