646
ctx context.Context,
647
task *tasks.WorkflowRunTimeoutTask,
649
>
ctx, cancel := context.WithTimeout(ctx, taskTimeout)
650
>
defer cancel()
651
>
652
>
weContext, release, err := getWorkflowExecutionContextForTask(ctx, t.shardContext, t.cache, task)
653
>
if err != nil {
654
return err
655
}
657
659
>
if err != nil {
660
return err
661
}
663
release(nil) // release(nil) so mutable state is not unloaded from cache
664
return consts.ErrWorkflowExecutionNotFound
665
}
667
release(nil) // release(nil) so mutable state is not unloaded from cache
668
return consts.ErrWorkflowCompleted
669
}
670
672
>
if err != nil {
673
return err
674
}
676
>
if err != nil {
677
return err
678
}
679
681
release(nil) // release(nil) so mutable state is not unloaded from cache
682
return errNoTimerFired
683
}
684
686
>
backoffInterval := backoff.NoBackoff
687
>
retryState := enumspb.RETRY_STATE_TIMEOUT
688
>
initiator := enumspb.CONTINUE_AS_NEW_INITIATOR_UNSPECIFIED
689
>
690
>
wfExpTime := mutableState.GetExecutionInfo().WorkflowExecutionExpirationTime
691
>
if wfExpTime == nil || wfExpTime.AsTime().IsZero() || wfExpTime.AsTime().After(mutableState.Now()) {
692
backoffInterval, retryState = mutableState.GetRetryBackoffDuration(timeoutFailure)
693
if backoffInterval != backoff.NoBackoff {