Skip to content
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

add activity dispatch configs to matching #4818

Merged
merged 6 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
add activity dispatch configs to matching
  • Loading branch information
mkolodezny committed May 5, 2022
commit 93a598eab075a9b31693c7784b3c0f9f2c2242b1
6 changes: 6 additions & 0 deletions common/dynamicconfig/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ const (
// Default value: false
// Allowed filters: DomainID
MatchingEnableTaskInfoLogByDomainID
// MatchingActivityTaskSyncMatchWaitTime is the amount of time activity task will wait to be sync matched
// KeyName: matching.activityTaskSyncMatchWaitTime
// Value type: Duration
// Default value: 100ms
// Allowed filters: DomainName
MatchingActivityTaskSyncMatchWaitTime

// key for history

Expand Down
8 changes: 4 additions & 4 deletions common/types/mapper/thrift/matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func FromAddActivityTaskRequest(t *types.AddActivityTaskRequest) *matching.AddAc
ScheduleToStartTimeoutSeconds: t.ScheduleToStartTimeoutSeconds,
Source: FromTaskSource(t.Source),
ForwardedFrom: &t.ForwardedFrom,
ActivityTaskDispatchInfo: FromSyncMatchActivityTaskInfo(t.ActivityTaskDispatchInfo),
mkolodezny marked this conversation as resolved.
Show resolved Hide resolved
ActivityTaskDispatchInfo: FromActivityTaskDispatchInfo(t.ActivityTaskDispatchInfo),
}
}

Expand All @@ -59,11 +59,11 @@ func ToAddActivityTaskRequest(t *matching.AddActivityTaskRequest) *types.AddActi
ScheduleToStartTimeoutSeconds: t.ScheduleToStartTimeoutSeconds,
Source: ToTaskSource(t.Source),
ForwardedFrom: t.GetForwardedFrom(),
ActivityTaskDispatchInfo: ToSyncMatchActivityTaskInfo(t.ActivityTaskDispatchInfo),
ActivityTaskDispatchInfo: ToActivityTaskDispatchInfo(t.ActivityTaskDispatchInfo),
}
}

func FromSyncMatchActivityTaskInfo(t *types.ActivityTaskDispatchInfo) *matching.ActivityTaskDispatchInfo {
func FromActivityTaskDispatchInfo(t *types.ActivityTaskDispatchInfo) *matching.ActivityTaskDispatchInfo {
if t == nil {
return nil
}
Expand All @@ -79,7 +79,7 @@ func FromSyncMatchActivityTaskInfo(t *types.ActivityTaskDispatchInfo) *matching.
}

// ToRecordActivityTaskStartedResponse converts thrift RecordActivityTaskStartedResponse type to internal
func ToSyncMatchActivityTaskInfo(t *matching.ActivityTaskDispatchInfo) *types.ActivityTaskDispatchInfo {
func ToActivityTaskDispatchInfo(t *matching.ActivityTaskDispatchInfo) *types.ActivityTaskDispatchInfo {
if t == nil {
return nil
}
Expand Down
3 changes: 3 additions & 0 deletions service/matching/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ type (
// debugging configuration
EnableDebugMode bool // note that this value is initialized once on service start
EnableTaskInfoLogByDomainID dynamicconfig.BoolPropertyFnWithDomainIDFilter

ActivityTaskSyncMatchWaitTime dynamicconfig.DurationPropertyFnWithDomainFilter
}

forwarderConfig struct {
Expand Down Expand Up @@ -126,6 +128,7 @@ func NewConfig(dc *dynamicconfig.Collection) *Config {
ShutdownDrainDuration: dc.GetDurationProperty(dynamicconfig.MatchingShutdownDrainDuration, 0),
EnableDebugMode: dc.GetBoolProperty(dynamicconfig.EnableDebugMode, false)(),
EnableTaskInfoLogByDomainID: dc.GetBoolPropertyFilteredByDomainID(dynamicconfig.MatchingEnableTaskInfoLogByDomainID, false),
ActivityTaskSyncMatchWaitTime: dc.GetDurationPropertyFilteredByDomain(dynamicconfig.HistoryLongPollExpirationInterval, time.Millisecond*100),
}
}

Expand Down