Skip to content

Commit

Permalink
Rename from EnableAutoConfig to EnableClientAutoConfig to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-xie committed Dec 5, 2024
1 parent 8c72a10 commit cb27c40
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
12 changes: 6 additions & 6 deletions common/dynamicconfig/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2077,12 +2077,12 @@ const (
// Allowed filters: DomainName
EnableStrongIdempotencySanityCheck

// MatchingEnableAutoConfig enables auto config for domain and tasklist on worker side
// KeyName: matching.enableAutoConfig
// MatchingEnableClientAutoConfig enables auto config for domain and tasklist on client (worker) side
// KeyName: matching.enableClientAutoConfig
// Value type: Bool
// Default value: false
// Allowed filters: DomainName,TasklistName,TasklistType
MatchingEnableAutoConfig
MatchingEnableClientAutoConfig

// LastBoolKey must be the last one in this const group
LastBoolKey
Expand Down Expand Up @@ -4420,10 +4420,10 @@ var BoolKeys = map[BoolKey]DynamicBool{
Description: "EnableStrongIdempotencySanityCheck enables sanity check for strong idempotency",
DefaultValue: false,
},
MatchingEnableAutoConfig: {
KeyName: "matching.enableAutoConfig",
MatchingEnableClientAutoConfig: {
KeyName: "matching.enableClientAutoConfig",
Filters: []Filter{DomainName, TaskListName, TaskType},
Description: "MatchingEnableAutoConfig is to enable auto config on worker side",
Description: "MatchingEnableClientAutoConfig is to enable auto config on worker side",
DefaultValue: false,
},
}
Expand Down
6 changes: 3 additions & 3 deletions service/matching/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type (
AdaptiveScalerUpdateInterval dynamicconfig.DurationPropertyFnWithTaskListInfoFilters
EnableAdaptiveScaler dynamicconfig.BoolPropertyFnWithTaskListInfoFilters
EnableStandbyTaskCompletion dynamicconfig.BoolPropertyFnWithTaskListInfoFilters
EnableAutoConfig dynamicconfig.BoolPropertyFnWithTaskListInfoFilters
EnableClientAutoConfig dynamicconfig.BoolPropertyFnWithTaskListInfoFilters

// Time to hold a poll request before returning an empty response if there are no tasks
LongPollExpirationInterval dynamicconfig.DurationPropertyFnWithTaskListInfoFilters
Expand Down Expand Up @@ -142,7 +142,7 @@ type (
MaxTimeBetweenTaskDeletes time.Duration
// standby task completion configuration
EnableStandbyTaskCompletion func() bool
EnableAutoConfig func() bool
EnableClientAutoConfig func() bool
}
)

Expand Down Expand Up @@ -195,6 +195,6 @@ func NewConfig(dc *dynamicconfig.Collection, hostName string, getIsolationGroups
MaxTimeBetweenTaskDeletes: time.Second,
AllIsolationGroups: getIsolationGroups,
EnableStandbyTaskCompletion: dc.GetBoolPropertyFilteredByTaskListInfo(dynamicconfig.MatchingEnableStandbyTaskCompletion),
EnableAutoConfig: dc.GetBoolPropertyFilteredByTaskListInfo(dynamicconfig.MatchingEnableAutoConfig),
EnableClientAutoConfig: dc.GetBoolPropertyFilteredByTaskListInfo(dynamicconfig.MatchingEnableClientAutoConfig),
}
}
4 changes: 4 additions & 0 deletions service/matching/handler/engine_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ func (s *matchingEngineSuite) PollForDecisionTasksResultTest() {
Name: tl,
Kind: &tlKind,
},
AutoConfigHint: &types.AutoConfigHint{
EnableAutoConfig: false,
PollerWaitTimeInMs: 0,
},
}

s.Nil(err)
Expand Down
4 changes: 2 additions & 2 deletions service/matching/tasklist/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ func (tm *taskMatcherImpl) Poll(ctx context.Context, isolationGroup string) (*In
tm.scope.RecordTimer(metrics.PollLocalMatchLatencyPerTaskList, time.Since(startT))
if task != nil {
task.AutoConfigHint = &types.AutoConfigHint{
EnableAutoConfig: tm.config.EnableAutoConfig(),
EnableAutoConfig: tm.config.EnableClientAutoConfig(),
PollerWaitTimeInMs: time.Since(startT).Milliseconds(),
}
}
Expand All @@ -438,7 +438,7 @@ func (tm *taskMatcherImpl) Poll(ctx context.Context, isolationGroup string) (*In
task, err := tm.pollOrForward(ctxWithCancelPropagation, startT, isolationGroup, isolatedTaskC, tm.taskC, tm.queryTaskC)
if task != nil {
task.AutoConfigHint = &types.AutoConfigHint{
EnableAutoConfig: tm.config.EnableAutoConfig(),
EnableAutoConfig: tm.config.EnableClientAutoConfig(),
PollerWaitTimeInMs: time.Since(startT).Milliseconds(),
}
}
Expand Down
4 changes: 2 additions & 2 deletions service/matching/tasklist/task_list_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,8 @@ func newTaskListConfig(id *Identifier, cfg *config.Config, domainName string) *c
EnableStandbyTaskCompletion: func() bool {
return cfg.EnableStandbyTaskCompletion(domainName, taskListName, taskType)
},
EnableAutoConfig: func() bool {
return cfg.EnableAutoConfig(domainName, taskListName, taskType)
EnableClientAutoConfig: func() bool {
return cfg.EnableClientAutoConfig(domainName, taskListName, taskType)
},
}
}
Expand Down

0 comments on commit cb27c40

Please sign in to comment.