Skip to content

Commit

Permalink
Detecting stale cache when RecordChildExecutionCompleted (#2354)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminc authored Jan 7, 2022
1 parent b13fccf commit fde1e4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/history/historyEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,9 @@ func (e *historyEngineImpl) RecordChildExecutionCompleted(

// Check mutable state to make sure child execution is in pending child executions
ci, isRunning := mutableState.GetChildExecutionInfo(initiatedID)
if !isRunning && initiatedID >= mutableState.GetNextEventID() {
return nil, consts.ErrStaleState
}
if !isRunning || ci.StartedId == common.EmptyEventID {
return nil, serviceerror.NewNotFound("Pending child execution not found.")
}
Expand Down

0 comments on commit fde1e4e

Please sign in to comment.