4897
batchID int64,
4898
event *historypb.HistoryEvent,
4900
>
if _, err := ms.UpdateWorkflowStateStatus(
4901
>
enumsspb.WORKFLOW_EXECUTION_STATE_COMPLETED,
4902
>
enumspb.WORKFLOW_EXECUTION_STATUS_FAILED,
4903
>
); err != nil {
4904
return err
4905
}
4906
>
ms.executionInfo.CompletionEventBatchId = batchID // Used when completion event needs to be loaded from database
mutable_state_impl.go
4907
>
ms.executionInfo.NewExecutionRunId = event.GetWorkflowExecutionFailedEventAttributes().GetNewExecutionRunId()
4908
>
ms.executionInfo.CloseTime = event.GetEventTime()
4909
>
ms.ClearStickyTaskQueue()
4910
>
ms.writeEventToCache(event)
4911
>
4912
>
attrs := event.GetWorkflowExecutionFailedEventAttributes()
4913
>
if attrs.RetryState != enumspb.RETRY_STATE_IN_PROGRESS {
4914
>
return ms.processCloseCallbacks()
4915
>
}
4916
// Workflow-level callbacks are inherited by the retry run, but update callbacks
4917
// must fire now because the update was aborted on the old run.