activitypb.ACTIVITY_EXECUTION_STATUS_TERMINATED,
activitypb.ACTIVITY_EXECUTION_STATUS_TIMED_OUT,
return chasm.LifecycleStateFailed
default:
return chasm.LifecycleStateRunning
Frontier kind: Code frontier
unlabeled · c_05d90acac24d
4 tests · 2692 LOC · 131 files · introduces 0 tests · 52 LOC · 3 files
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Introduced files, introduced tests, and structurally relevant concept specialization
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
Every exact file and test below is linked only from the concept that introduces it.
go.temporal.io/server/common/persistence/client/TestQuotasSuite/TestAPITypeCallOriginPriorityOverrideMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestBackgroundTypeAPIPriorityOverrideMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestCallerTypeDefaultPriorityMappinggo.temporal.io/server/common/persistence/client/TestQuotasSuite/TestRequestPrioritiesOrderedgo.temporal.io/server/common/circuitbreaker/TestTSCBWithDynamicSettingsgo.temporal.io/server/common/dynamicconfig/TestDeepCopy_OtherReferenceTypes_Nilgo.temporal.io/server/service/matching/configs/TestQuotasSuite/TestAPIPrioritiesOrderedgo.temporal.io/server/service/matching/configs/TestQuotasSuite/TestAPIToPriorityMappingEvery collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
3 files ranked by introduced lines: 52 introduced LOC across 15 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
activitypb.ACTIVITY_EXECUTION_STATUS_TERMINATED,
activitypb.ACTIVITY_EXECUTION_STATUS_TIMED_OUT,
return chasm.LifecycleStateFailed
default:
return chasm.LifecycleStateRunning
overridingRetryInterval time.Duration,
failure *failurepb.Failure,
retryState, retryInterval := a.shouldRetry(ctx, overridingRetryInterval)
if !failureRetryable {
retryState = enumspb.RETRY_STATE_NON_RETRYABLE_FAILURE
}
resetRequested := a.GetStatus() == activitypb.ACTIVITY_EXECUTION_STATUS_RESET_REQUESTED
activity.go
// A pending reset request is always honored, regardless of retryability or the should retry result.
if !resetRequested && retryState != enumspb.RETRY_STATE_IN_PROGRESS {
return retryState, nil
}
retryIntervalSource := activitypb.ACTIVITY_RETRY_INTERVAL_SOURCE_RETRY_POLICY
if overridingRetryInterval > 0 {
}
func (a *Activity) shouldRetry(ctx chasm.Context, overridingRetryInterval time.Duration) (enumspb.RetryState, time.Duration) {
activity.go
if !TransitionRescheduled.Possible(a) &&
!TransitionAttemptFailedWhilePauseRequested.Possible(a) &&
!TransitionResetAttemptFailedToScheduled.Possible(a) &&
!TransitionResetAttemptFailedToPaused.Possible(a) {
return enumspb.RETRY_STATE_UNSPECIFIED, 0
}
retryPolicy := a.RetryPolicy
enoughTime, retryInterval := a.hasEnoughTimeForRetry(ctx, overridingRetryInterval)
if retryPolicy.GetMaximumAttempts() > 0 && attempt.GetCount() >= retryPolicy.GetMaximumAttempts() {
return enumspb.RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED, retryInterval
}
// hasEnoughTimeForRetry checks if there is enough time left in the schedule-to-close timeout. If sufficient time
// remains, it will also return a valid retry interval.
func (a *Activity) hasEnoughTimeForRetry(ctx chasm.Context, overridingRetryInterval time.Duration) (bool, time.Duration) {
activity.go
attempt := a.LastAttempt.Get(ctx)
// Use overriding retry interval if provided, else calculate based on retry policy
retryInterval := overridingRetryInterval
if retryInterval <= 0 {
retryInterval = backoff.CalculateExponentialRetryInterval(a.RetryPolicy, attempt.Count)
}
if scheduleToClose == 0 {
return true, retryInterval
}
return ctx.Now(a).Add(retryInterval).Before(deadline), retryInterval
}
// outcome retrieves the activity outcome (result or failure) if the activity has completed.
// Returns nil if the activity has not completed.
func (a *Activity) outcome(ctx chasm.Context) *apiactivitypb.ActivityExecutionOutcome {
activity.go
if !a.LifecycleState(ctx).IsClosed() {
return nil
}
if successful := activityOutcome.GetSuccessful(); successful != nil {
return &apiactivitypb.ActivityExecutionOutcome{
Value: &apiactivitypb.ActivityExecutionOutcome_Result{Result: successful.GetOutput()},
}
}
return &apiactivitypb.ActivityExecutionOutcome{
Value: &apiactivitypb.ActivityExecutionOutcome_Failure{Failure: failure},
}
}
return nil
}
// (terminated, canceled, timed out) or in LastAttempt.LastFailureDetails (failed after exhausting retries).
// Returns nil if no failure is found.
if f := a.Outcome.Get(ctx).GetFailed(); f != nil {
return f.GetFailure()
}
// CalculateExponentialRetryInterval calculates the retry interval using exponential backoff algorithm
func CalculateExponentialRetryInterval(retryPolicy *commonpb.RetryPolicy, attempt int32) time.Duration {
retry.go
interval := ExponentialBackoffAlgorithm(retryPolicy.GetInitialInterval(), retryPolicy.GetBackoffCoefficient(), attempt)
maxInterval := retryPolicy.GetMaximumInterval()
// Cap interval to maximum if it's set
if maxInterval.AsDuration() != 0 && interval > maxInterval.AsDuration() {
interval = maxInterval.AsDuration()
}
}