From cb27c409e61bc0c92a139f0b6755b92b76b21993 Mon Sep 17 00:00:00 2001 From: Neil Xie Date: Thu, 5 Dec 2024 12:47:04 -0800 Subject: [PATCH] Rename from EnableAutoConfig to EnableClientAutoConfig to be more clear --- common/dynamicconfig/constants.go | 12 ++++++------ service/matching/config/config.go | 6 +++--- service/matching/handler/engine_integration_test.go | 4 ++++ service/matching/tasklist/matcher.go | 4 ++-- service/matching/tasklist/task_list_manager.go | 4 ++-- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/common/dynamicconfig/constants.go b/common/dynamicconfig/constants.go index f595dfabe5e..df35b2c766b 100644 --- a/common/dynamicconfig/constants.go +++ b/common/dynamicconfig/constants.go @@ -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 @@ -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, }, } diff --git a/service/matching/config/config.go b/service/matching/config/config.go index e4af8181cec..45e9cc31654 100644 --- a/service/matching/config/config.go +++ b/service/matching/config/config.go @@ -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 @@ -142,7 +142,7 @@ type ( MaxTimeBetweenTaskDeletes time.Duration // standby task completion configuration EnableStandbyTaskCompletion func() bool - EnableAutoConfig func() bool + EnableClientAutoConfig func() bool } ) @@ -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), } } diff --git a/service/matching/handler/engine_integration_test.go b/service/matching/handler/engine_integration_test.go index 54b29c99b9e..c54c3e3b903 100644 --- a/service/matching/handler/engine_integration_test.go +++ b/service/matching/handler/engine_integration_test.go @@ -330,6 +330,10 @@ func (s *matchingEngineSuite) PollForDecisionTasksResultTest() { Name: tl, Kind: &tlKind, }, + AutoConfigHint: &types.AutoConfigHint{ + EnableAutoConfig: false, + PollerWaitTimeInMs: 0, + }, } s.Nil(err) diff --git a/service/matching/tasklist/matcher.go b/service/matching/tasklist/matcher.go index 3f5d195310d..975790eca45 100644 --- a/service/matching/tasklist/matcher.go +++ b/service/matching/tasklist/matcher.go @@ -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(), } } @@ -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(), } } diff --git a/service/matching/tasklist/task_list_manager.go b/service/matching/tasklist/task_list_manager.go index a87ed4ef9f3..7ba72f14085 100644 --- a/service/matching/tasklist/task_list_manager.go +++ b/service/matching/tasklist/task_list_manager.go @@ -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) }, } }