-
Notifications
You must be signed in to change notification settings - Fork 1.5k
TaskGroups for chasm tasks #9949
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
base: main
Are you sure you want to change the base?
Changes from all commits
4155f25
5b45155
699953b
9bdb358
b59539b
2a31a60
0aa9c97
e012ba0
e12cec2
32a5cb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ package history | |
| import ( | ||
| "fmt" | ||
|
|
||
| "go.temporal.io/server/chasm" | ||
| "go.temporal.io/server/client" | ||
| "go.temporal.io/server/common/collection" | ||
| "go.temporal.io/server/common/dynamicconfig" | ||
|
|
@@ -307,6 +308,7 @@ func (f *outboundQueueFactory) CreateQueue( | |
| logger, | ||
| metricsHandler, | ||
| factory, | ||
| outboundTaskGroupPostProcessor(f.ChasmRegistry), | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -359,3 +361,18 @@ func getNamespaceNameOrDefault( | |
| } | ||
| return nsName.String() | ||
| } | ||
|
|
||
| func outboundTaskGroupPostProcessor(registry *chasm.Registry) func([]tasks.Task) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with this being here as long as you can guarantee that the task group is populated on any chasm task before the property is read anywhere. Can you confirm that |
||
| if registry == nil { | ||
| return nil | ||
| } | ||
| return func(taskSlice []tasks.Task) { | ||
| for _, t := range taskSlice { | ||
| if ct, ok := t.(*tasks.ChasmTask); ok { | ||
| if rt, ok := registry.TaskByID(ct.Info.GetTypeId()); ok { | ||
| ct.SetOutboundTaskGroup(rt.TaskGroup()) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,5 +202,6 @@ func (f *transferQueueFactory) CreateQueue( | |
| logger, | ||
| metricsHandler, | ||
| factory, | ||
| nil, // taskPostProcessor | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,5 +168,6 @@ func (f *visibilityQueueFactory) CreateQueue( | |
| logger, | ||
| metricsHandler, | ||
| factory, | ||
| nil, // taskPostProcessor | ||
| ) | ||
| } | ||
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.
I know @yycptt said he'd rather use "side effect" for the naming here. I would prefer we use outbound because that's the only place where it's applicable. I would be okay with side-effect too or just
WithTaskGroupbut don't like the inconsistency between the name of the field and the name of this option.As long as we're consistent, I'm fine with whatever.