Skip to content

Commit

Permalink
Clear stickyness if it is not being used when scheduling decision (ub…
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Aug 7, 2019
1 parent aadf5dc commit 067fd21
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 @@ -1383,6 +1383,13 @@ func (e *mutableStateBuilder) AddDecisionTaskScheduledEventAsHeartbeat(
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 @@ -155,6 +155,7 @@ type Config struct {

// Decision settings
// 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
// DecisionHeartbeatTimeout is to timeout behavior of: RespondDecisionTaskComplete with ForceCreateNewDecisionTask == true without any decisions
// So that decision will be scheduled to another worker(by clear stickyness)
Expand Down

0 comments on commit 067fd21

Please sign in to comment.