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 ttl for sticky task list #510

Merged
merged 5 commits into from
Jan 24, 2018
Merged

Add ttl for sticky task list #510

merged 5 commits into from
Jan 24, 2018

Conversation

vancexu
Copy link
Contributor

@vancexu vancexu commented Jan 17, 2018

This will delete sticky task list in one day after no ack update happens for that task list.
Relate issue: #472

Copy link

@yiminc-zz yiminc-zz left a comment

Choose a reason for hiding this comment

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

please double check that old client that does not set the kind field should still works

return &LeaseTaskListResponse{TaskListInfo: tli}, nil
}

// From TaskManager interface
func (d *cassandraPersistence) UpdateTaskList(request *UpdateTaskListRequest) (*UpdateTaskListResponse, error) {
tli := request.TaskListInfo

if tli.Kind == TaskListKindWorker { // if task_list is sticky, then update with TTL
fmt.Println("vancexu in updateTaskList with TTL")

Choose a reason for hiding this comment

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

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, Thanks for catching this.

// Kinds of task lists
const (
TaskListKindNormal = iota
TaskListKindWorker

Choose a reason for hiding this comment

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

rename to Sticky

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -196,6 +196,11 @@ enum HistoryEventFilterType {
CLOSE_EVENT,
}

enum TaskListKind {
NORMAL,
WORKER,

Choose a reason for hiding this comment

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

rename WORKER to STICKY

@@ -132,6 +132,7 @@ CREATE TYPE task_list (
name text,
type int, -- enum TaskRowType {ActivityTask, DecisionTask}
ack_level bigint, -- task_id of the last acknowledged message
kind int, -- enum TaskListKind {Normal, Worker}

Choose a reason for hiding this comment

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

update comments after rename WORKER to STICKY

@vancexu
Copy link
Contributor Author

vancexu commented Jan 23, 2018

Manually test old client works, but in that case the tasklist will be treated as NORMAL all the time and wouldn't be removed automatically.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 67.354% when pulling 445693c on stickyttl into b9c8eef on master.

@vancexu vancexu merged commit b7dc627 into master Jan 24, 2018
@vancexu vancexu deleted the stickyttl branch January 24, 2018 01:16
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