-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add MSPointer to CHASM framework #8485
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
Conversation
bergundy
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.
Had some comments but non of them are blocking.
chasm/lib/workflow/workflow.go
Outdated
| // State of the workflow is managed by mutable_state_impl, not CHASM engine, so this will always be empty. | ||
| State proto.Message |
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.
| // State of the workflow is managed by mutable_state_impl, not CHASM engine, so this will always be empty. | |
| State proto.Message | |
| // State of the workflow is managed by mutable_state_impl, not CHASM engine, so this will always be empty. | |
| *emptypb.Empty |
| State proto.Message | ||
|
|
||
| // MSPointer is a special in-memory field for getting mutable state access. | ||
| MSPointer chasm.MSPointer |
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.
No other component is allowed to have this pointer and this is really just a transitional artifact (even if the transition may take years).
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.
Ideally the CHASM framework would panic if any other component tried to use this hack.
|
|
||
| if ms.chasmEnabled() { | ||
| // Initialize chasm tree once for new workflows. | ||
| mutableContext := chasm.NewMutableContext(context.TODO(), ms.chasmTree.(*chasm.Node)) |
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.
| s.nodeBackend.EXPECT().GetCurrentVersion().Return(int64(1)).AnyTimes() | ||
| s.nodeBackend.EXPECT().UpdateWorkflowStateStatus(gomock.Any(), gomock.Any()).Return(true, nil).AnyTimes() | ||
| s.nodeBackend.EXPECT().GetWorkflowKey().Return(tv.Any().WorkflowKey()).AnyTimes() | ||
| s.nodeBackend.EXPECT().IsWorkflow().Return(false).AnyTimes() |
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.
@lina-temporal, @yycptt this is what you get when you use these tight mocks, every little behavior change needs to be propagated to every test in the codebase.
## What changed? - Wire up chasm workflow library ## Why? - #8485 makes workflow start to use CHASM as well and we need to register workflow as a chasm library. ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks - Logic is only used when chasm feature flag is turned on. The change is mainly for functional tests.
## What changed? - Wire up chasm workflow library ## Why? - #8485 makes workflow start to use CHASM as well and we need to register workflow as a chasm library. ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks - Logic is only used when chasm feature flag is turned on. The change is mainly for functional tests.
What changed?
Added a new special
MSPointertype to the CHASM frameworkWhy?
To support components invoking methods from the underlying mutable state. Specifically, Nexus callbacks will need to get the Nexus completion from the mutable state.
How did you test it?
updated unit tests