648
// operation to timed-out. It does NOT emit metrics; the caller reads the resulting state and decides
649
// when/whether to emit (the saveResult path emits post-commit, executeOperationTimeout pre-commit).
650
>
func (e taskExecutor) recordOperationTimeout(node *hsm.Node, timeoutType enumspb.TimeoutType) error {
executors.go
651
>
return hsm.MachineTransition(node, func(op Operation) (hsm.TransitionOutput, error) {
652
>
eventID, err := hsm.EventIDFromToken(op.ScheduledEventToken)
653
>
if err != nil {
654
return hsm.TransitionOutput{}, err
655
}
656
>
node.AddHistoryEvent(enumspb.EVENT_TYPE_NEXUS_OPERATION_TIMED_OUT, func(e *historypb.HistoryEvent) {
executors.go
657
>
// nolint:revive // We must mutate here even if the linter doesn't like it.
658
>
e.Attributes = &historypb.HistoryEvent_NexusOperationTimedOutEventAttributes{
659
>
NexusOperationTimedOutEventAttributes: &historypb.NexusOperationTimedOutEventAttributes{
660
>
Failure: createNexusOperationFailure(
661
>
op,
662
>
eventID,
663
>
&failurepb.Failure{
664
>
Message: "operation timed out",
665
>
FailureInfo: &failurepb.Failure_TimeoutFailureInfo{
666
>
TimeoutFailureInfo: &failurepb.TimeoutFailureInfo{
667
>
TimeoutType: timeoutType,
668
>
},
669
>
},
670
>
},
671
>
),
672
>
ScheduledEventId: eventID,
673
>
RequestId: op.RequestId,
674
>
},
675
>
}
676
>
})
677
678
>
return TransitionTimedOut.Apply(op, EventTimedOut{
executors.go
679
>
Node: node,
680
>
})
681
})
682
}