269
// cleanup (e.g., registry clear, workflow close) where a hard error would be
270
// worse than silently clearing.
272
>
273
>
u.instrumentation.countAborted(u.id, reason)
274
>
prevState := u.setState(stateProvisionallyAborted)
275
>
276
>
effects.OnAfterCommit(func(context.Context) {
277
>
if !u.state.Matches(stateSet(stateProvisionallyAborted | stateProvisionallyCompletedAfterAccepted)) {
278
return
279
}
280
>
var abortOutcome *updatepb.Outcome
update.go
281
>
if abortFailure != nil {
282
abortOutcome = &updatepb.Outcome{Value: &updatepb.Outcome_Failure{Failure: abortFailure}}
283
}
284
285
>
beforeCommitState := u.setState(stateAborted)
update.go
286
>
u.outcome.(*future.FutureImpl[*updatepb.Outcome]).Set(abortOutcome, abortErr)
287
>
if beforeCommitState == stateProvisionallyCompletedAfterAccepted {
288
// If the Update is accepted *and* aborted in the same WFT (because WF was completed in the same WFT),
289
// then its state is ProvisionallyCompletedAfterAccepted here, set by onAcceptance.OnAfterCommit.