Skip to content

Commit

Permalink
Clear stickyness if it is not being used when scheduling decision (#2358
Browse files Browse the repository at this point in the history
)
  • Loading branch information
longquanzheng committed Aug 8, 2019
1 parent 7be94e9 commit 9242999
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions service/history/mutableStateBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,13 @@ func (e *mutableStateBuilder) AddDecisionTaskScheduledEvent() (*decisionInfo, er
taskList := e.executionInfo.TaskList
if e.IsStickyTaskListEnabled() {
taskList = e.executionInfo.StickyTaskList
} else {
// It can be because stickyness has expired due to StickyTTL config
// In that case we need to clear stickyness so that the LastUpdateTimestamp is not corrupted.
// In other cases, clearing stickyness shouldn't hurt anything.
// TODO: https://github.com/uber/cadence/issues/2357:
// if we can use a new field(LastDecisionUpdateTimestamp), then we could get rid of it.
e.ClearStickyness()
}
startToCloseTimeoutSeconds := e.executionInfo.DecisionTimeoutValue

Expand Down
1 change: 1 addition & 0 deletions service/history/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ type Config struct {
SearchAttributesTotalSizeLimit dynamicconfig.IntPropertyFnWithDomainFilter

// StickyTTL is to expire a sticky tasklist if no update more than this duration
// TODO https://github.com/uber/cadence/issues/2357
StickyTTL dynamicconfig.DurationPropertyFnWithDomainFilter
}

Expand Down

0 comments on commit 9242999

Please sign in to comment.