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

Refactor and fix matching dynamic configs #857

Merged
merged 5 commits into from
Jun 20, 2018
Merged

Refactor and fix matching dynamic configs #857

merged 5 commits into from
Jun 20, 2018

Conversation

vancexu
Copy link
Contributor

@vancexu vancexu commented Jun 15, 2018

Previous matching configs are only filtered by tasklist, which is not correct because taskList might be same for different domain.
This change all matching configs to dynamic configs, and filtered by domain, taskListName, taskType.

@@ -236,6 +239,8 @@ const (
DomainName
// TaskListName is the tasklist name
TaskListName
// TaskType is the task type (0:Decision, 1:Activity)
TaskType
Copy link
Contributor

@samarabbas samarabbas Jun 19, 2018

Choose a reason for hiding this comment

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

Probably you need to have a filters item for TaskType filter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, addressed. Will also change and strengthen unit test for these later

@@ -230,7 +237,7 @@ func (e *matchingEngineImpl) AddActivityTask(addRequest *m.AddActivityTaskReques
sourceDomainID := addRequest.GetSourceDomainUUID()
taskListName := addRequest.TaskList.GetName()
taskListKind := common.TaskListKindPtr(addRequest.TaskList.GetKind())
e.logger.Debugf("Received AddActivityTask for taskList=%v WorkflowID=%v, RunID=%v",
e.logger.Infof("Received AddActivityTask for taskList=%v WorkflowID=%v, RunID=%v",
Copy link
Contributor

Choose a reason for hiding this comment

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

This could get very noisy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

OutstandingTaskAppendsThreshold: dc.GetIntProperty(dynamicconfig.MatchingOutstandingTaskAppendsThreshold, 250),
MaxTaskBatchSize: dc.GetIntProperty(dynamicconfig.MatchingMaxTaskBatchSize, 100),
GetTasksBatchSize: dc.GetIntPropertyFilteredByTaskListInfo(dynamicconfig.MatchingGetTasksBatchSize, 1000),
UpdateAckInterval: dc.GetDurationPropertyFilteredByTaskListInfo(dynamicconfig.MatchingUpdateAckInterval, 10*time.Second),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change this to 1 Minute. It could become a problem if number of tasklist grows in the system.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

}

func newTaskListConfig(id *taskListID, config *Config) *taskListConfig {
func newTaskListConfig(id *taskListID, config *Config, domainCache cache.DomainCache) (*taskListConfig, error) {
domainEntry, err := domainCache.GetDomainByID(id.domainID)
Copy link
Contributor

Choose a reason for hiding this comment

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

@wxing1292 Can you review this to make sure whether it is OK to host DomainCache within Matching Engine? Another option is to pass in DomainName along with DomainID on all Matching Engine API calls.

Copy link
Contributor

Choose a reason for hiding this comment

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

@samarabbas the initialization in matching side looks fine

Copy link
Contributor

@samarabbas samarabbas left a comment

Choose a reason for hiding this comment

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

Please address my comments.

@vancexu vancexu merged commit 49fd3c0 into master Jun 20, 2018
@vancexu vancexu deleted the dynamicConfig branch June 20, 2018 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants