Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/activity_task_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func newActivityTaskHandlerWithCustomProvider(
}
return &activityTaskHandlerImpl{
clock: clock,
taskListName: params.TaskList,
taskListName: params.TaskList.GetName(),
identity: params.Identity,
service: service,
logger: params.Logger,
Expand Down
1 change: 1 addition & 0 deletions internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ func getFeatureFlags(options *ClientOptions) FeatureFlags {
return FeatureFlags{
WorkflowExecutionAlreadyCompletedErrorEnabled: options.FeatureFlags.WorkflowExecutionAlreadyCompletedErrorEnabled,
PollerAutoScalerEnabled: options.FeatureFlags.PollerAutoScalerEnabled,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a comment: this flag is no longer used and I'll delete it in the next PR

EphemeralTaskListsEnabled: options.FeatureFlags.EphemeralTaskListsEnabled,
}
}
return FeatureFlags{}
Expand Down
19 changes: 18 additions & 1 deletion internal/compatibility/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,27 @@ func TestDescribeTaskListResponse(t *testing.T) {
thrift.DescribeTaskListResponse,
proto.DescribeTaskListResponse,
FuzzOptions{
CustomFuncs: []interface{}{
func(e *apiv1.TaskListKind, c fuzz.Continue) {
validValues := []apiv1.TaskListKind{
apiv1.TaskListKind_TASK_LIST_KIND_INVALID,
apiv1.TaskListKind_TASK_LIST_KIND_NORMAL,
apiv1.TaskListKind_TASK_LIST_KIND_STICKY,
}
*e = validValues[c.Intn(len(validValues))]
},
func(e *apiv1.TaskListType, c fuzz.Continue) {
validValues := []apiv1.TaskListType{
apiv1.TaskListType_TASK_LIST_TYPE_INVALID,
apiv1.TaskListType_TASK_LIST_TYPE_DECISION,
apiv1.TaskListType_TASK_LIST_TYPE_ACTIVITY,
}
*e = validValues[c.Intn(len(validValues))]
},
},
ExcludedFields: []string{
"PartitionConfig", // [BUG] PartitionConfig field is lost during round trip - complex nested maps with TaskListPartition not preserved
"TaskListStatus", // [BUG] TaskListStatus fields IsolationGroupMetrics and NewTasksPerSecond are not mapped - they become nil/0 after round trip
"TaskList", // [BUG] TaskList field is lost during round trip - mapper not preserving this field correctly
},
},
)
Expand Down
1 change: 1 addition & 0 deletions internal/compatibility/enum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func TestTaskListKind(t *testing.T) {
apiv1.TaskListKind_TASK_LIST_KIND_INVALID,
apiv1.TaskListKind_TASK_LIST_KIND_NORMAL,
apiv1.TaskListKind_TASK_LIST_KIND_STICKY,
apiv1.TaskListKind_TASK_LIST_KIND_EPHEMERAL,
} {
assert.Equal(t, item, proto.TaskListKind(thrift.TaskListKind(item)))
}
Expand Down
2 changes: 2 additions & 0 deletions internal/compatibility/proto/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func TaskListKind(t *shared.TaskListKind) apiv1.TaskListKind {
return apiv1.TaskListKind_TASK_LIST_KIND_NORMAL
case shared.TaskListKindSticky:
return apiv1.TaskListKind_TASK_LIST_KIND_STICKY
case shared.TaskListKindEphemeral:
return apiv1.TaskListKind_TASK_LIST_KIND_EPHEMERAL
}
panic("unexpected enum value")
}
Expand Down
1 change: 1 addition & 0 deletions internal/compatibility/proto/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func DescribeTaskListResponse(t *shared.DescribeTaskListResponse) *apiv1.Describ
return &apiv1.DescribeTaskListResponse{
Pollers: PollerInfoArray(t.Pollers),
TaskListStatus: TaskListStatus(t.TaskListStatus),
TaskList: TaskList(t.TaskList),
}
}

Expand Down
2 changes: 2 additions & 0 deletions internal/compatibility/thrift/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func TaskListKind(t apiv1.TaskListKind) *shared.TaskListKind {
return shared.TaskListKindNormal.Ptr()
case apiv1.TaskListKind_TASK_LIST_KIND_STICKY:
return shared.TaskListKindSticky.Ptr()
case apiv1.TaskListKind_TASK_LIST_KIND_EPHEMERAL:
return shared.TaskListKindEphemeral.Ptr()
}
panic("unexpected enum value")
}
Expand Down
1 change: 1 addition & 0 deletions internal/compatibility/thrift/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func DescribeTaskListResponse(t *apiv1.DescribeTaskListResponse) *shared.Describ
return &shared.DescribeTaskListResponse{
Pollers: PollerInfoArray(t.Pollers),
TaskListStatus: TaskListStatus(t.TaskListStatus),
TaskList: TaskList(t.TaskList),
}
}

Expand Down
1 change: 1 addition & 0 deletions internal/internal_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type (
activityOptions struct {
ActivityID *string // Users can choose IDs but our framework makes it optional to decrease the crust.
TaskListName string
TaskListKind shared.TaskListKind
ScheduleToCloseTimeoutSeconds int32
ScheduleToStartTimeoutSeconds int32
StartToCloseTimeoutSeconds int32
Expand Down
9 changes: 8 additions & 1 deletion internal/internal_event_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ type (
contextPropagators []ContextPropagator
tracer opentracing.Tracer
workflowInterceptorFactories []WorkflowInterceptorFactory
featureFlags FeatureFlags
}

localActivityTask struct {
Expand Down Expand Up @@ -205,6 +206,7 @@ func newWorkflowExecutionEventHandler(
contextPropagators []ContextPropagator,
tracer opentracing.Tracer,
workflowInterceptorFactories []WorkflowInterceptorFactory,
featureFlags FeatureFlags,
) workflowExecutionEventHandler {
context := &workflowEnvironmentImpl{
workflowInfo: workflowInfo,
Expand All @@ -222,6 +224,7 @@ func newWorkflowExecutionEventHandler(
contextPropagators: contextPropagators,
tracer: tracer,
workflowInterceptorFactories: workflowInterceptorFactories,
featureFlags: featureFlags,
}
context.logger = logger.With(
zapcore.Field{Key: tagWorkflowType, Type: zapcore.StringType, String: workflowInfo.WorkflowType.Name},
Expand Down Expand Up @@ -472,7 +475,7 @@ func (wc *workflowEnvironmentImpl) ExecuteActivity(parameters executeActivityPar
}
activityID := scheduleTaskAttr.GetActivityId()
scheduleTaskAttr.ActivityType = activityTypePtr(parameters.ActivityType)
scheduleTaskAttr.TaskList = common.TaskListPtr(m.TaskList{Name: common.StringPtr(parameters.TaskListName)})
scheduleTaskAttr.TaskList = common.TaskListPtr(m.TaskList{Name: common.StringPtr(parameters.TaskListName), Kind: parameters.TaskListKind.Ptr()})
scheduleTaskAttr.Input = parameters.Input
scheduleTaskAttr.ScheduleToCloseTimeoutSeconds = common.Int32Ptr(parameters.ScheduleToCloseTimeoutSeconds)
scheduleTaskAttr.StartToCloseTimeoutSeconds = common.Int32Ptr(parameters.StartToCloseTimeoutSeconds)
Expand Down Expand Up @@ -804,6 +807,10 @@ func (wc *workflowEnvironmentImpl) GetWorkflowInterceptors() []WorkflowIntercept
return wc.workflowInterceptorFactories
}

func (wc *workflowEnvironmentImpl) GetFeatureFlags() FeatureFlags {
return wc.featureFlags
}

func (weh *workflowExecutionEventHandlerImpl) ProcessEvent(
event *m.HistoryEvent,
isReplay bool,
Expand Down
1 change: 1 addition & 0 deletions internal/internal_event_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ func testWorkflowExecutionEventHandler(t *testing.T, registry *registry) *workfl
nil,
opentracing.NoopTracer{},
nil,
FeatureFlags{},
).(*workflowExecutionEventHandlerImpl)
}

Expand Down
3 changes: 3 additions & 0 deletions internal/internal_task_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ type (
tracer opentracing.Tracer
workflowInterceptorFactories []WorkflowInterceptorFactory
disableStrictNonDeterminism bool
featureFlags FeatureFlags
}

activityProvider func(name string) activity
Expand Down Expand Up @@ -420,6 +421,7 @@ func newWorkflowTaskHandler(
tracer: params.Tracer,
workflowInterceptorFactories: params.WorkflowInterceptorChainFactories,
disableStrictNonDeterminism: params.WorkerBugPorts.DisableStrictNonDeterminismCheck,
featureFlags: params.FeatureFlags,
}

traceLog(func() {
Expand Down Expand Up @@ -623,6 +625,7 @@ func (w *workflowExecutionContextImpl) createEventHandler() {
w.wth.contextPropagators,
w.wth.tracer,
w.wth.workflowInterceptorFactories,
w.wth.featureFlags,
)
w.eventHandler.Store(eventHandler)
}
Expand Down
Loading