Skip to content

Commit

Permalink
Fix execution time not set correctly during continue as new (#1828)
Browse files Browse the repository at this point in the history
* Execution time is not set correctly during continue as new (cron / retry)
  • Loading branch information
wxing1292 authored and yiminc committed Aug 18, 2021
1 parent 1a3b4bd commit 6ef5257
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions service/history/workflow/mutable_state_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,6 @@ func (e *MutableStateImpl) AddWorkflowExecutionStartedEvent(
return nil, e.createInternalServerError(opTag)
}

e.executionInfo.ExecutionTime = timestamp.TimePtr(e.executionInfo.StartTime.Add(timestamp.DurationValue(startRequest.GetFirstWorkflowTaskBackoff())))

event := e.hBuilder.AddWorkflowExecutionStartedEvent(
*e.executionInfo.StartTime,
startRequest,
Expand Down Expand Up @@ -1438,6 +1436,10 @@ func (e *MutableStateImpl) ReplicateWorkflowExecutionStartedEvent(
e.executionInfo.InitiatedId = common.EmptyEventID
}

e.executionInfo.ExecutionTime = timestamp.TimePtr(
e.executionInfo.StartTime.Add(timestamp.DurationValue(event.GetFirstWorkflowTaskBackoff())),
)

e.executionInfo.Attempt = event.GetAttempt()
if !timestamp.TimeValue(event.GetWorkflowExecutionExpirationTime()).IsZero() {
e.executionInfo.WorkflowExecutionExpirationTime = event.GetWorkflowExecutionExpirationTime()
Expand Down

0 comments on commit 6ef5257

Please sign in to comment.