Skip to content

Commit 525929e

Browse files
committed
Breaking change to current_retry_interval
Return nil after dispatch to Matching. Consider an activity that's in retry backoff before attempt 2. This retry interval is 5s and the next one, if there is another, will be 10s. current_retry_interval: SCHEDULED (dispatched to matching) STARTED (attempt completed/failed) before 5s 10s nil after 5s nil nil next_attempt_schedule_time for comparison: SCHEDULED (dispatched to matching at t) STARTED (attempt completed/failed) t nil nil
1 parent 8c58841 commit 525929e

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

service/history/workflow/activity.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,14 @@ func GetPendingActivityInfo(
121121
if p.State == enumspb.PENDING_ACTIVITY_STATE_SCHEDULED {
122122
scheduledTime := ai.ScheduledTime.AsTime()
123123
if now.Before(scheduledTime) {
124-
// in this case activity is waiting for a retry
124+
// waiting for the retry to be dispatched to Matching
125125
p.NextAttemptScheduleTime = ai.ScheduledTime
126126
currentRetryDuration := p.NextAttemptScheduleTime.AsTime().Sub(p.LastAttemptCompleteTime.AsTime())
127127
p.CurrentRetryInterval = durationpb.New(currentRetryDuration)
128128
} else {
129-
// in this case activity is at least scheduled
129+
// retry has been dispatched to Matching
130130
p.NextAttemptScheduleTime = nil
131-
// we rely on the fact that ExponentialBackoffAlgorithm is deterministic, and there's no random jitter
132-
interval := backoff.ExponentialBackoffAlgorithm(ai.RetryInitialInterval, ai.RetryBackoffCoefficient, p.Attempt)
133-
p.CurrentRetryInterval = durationpb.New(interval)
131+
p.CurrentRetryInterval = nil
134132
}
135133
}
136134
}

0 commit comments

Comments
 (0)