-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Breaking change to current_retry_interval #11203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c86aa47
c5b7195
99743dc
4700086
14df9d7
dd3c00c
34267ef
5676d92
c1ac44a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,17 +120,15 @@ func GetPendingActivityInfo( | |
| p.Attempt = ai.Attempt | ||
| if p.State == enumspb.PENDING_ACTIVITY_STATE_SCHEDULED { | ||
| scheduledTime := ai.ScheduledTime.AsTime() | ||
| if now.Before(scheduledTime) { | ||
| // in this case activity is waiting for a retry | ||
| if now.Before(scheduledTime) && !ai.Paused { | ||
| // waiting for the retry to be dispatched to Matching | ||
| p.NextAttemptScheduleTime = ai.ScheduledTime | ||
| currentRetryDuration := p.NextAttemptScheduleTime.AsTime().Sub(p.LastAttemptCompleteTime.AsTime()) | ||
| p.CurrentRetryInterval = durationpb.New(currentRetryDuration) | ||
| } else { | ||
| // in this case activity is at least scheduled | ||
| // retry has been dispatched to Matching, or the activity is paused so no dispatch will occur | ||
| p.NextAttemptScheduleTime = nil | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: technically this else clause is not needed since p is freshly created (line 100). But if you want to keep it here for clarity and behavior doc, that's fine
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I think I'll leave it seeing as the code is going away, and there are other things in it that could be cleaned up. CHASM is the real clean up. |
||
| // we rely on the fact that ExponentialBackoffAlgorithm is deterministic, and there's no random jitter | ||
| interval := backoff.ExponentialBackoffAlgorithm(ai.RetryInitialInterval, ai.RetryBackoffCoefficient, p.Attempt) | ||
| p.CurrentRetryInterval = durationpb.New(interval) | ||
| p.CurrentRetryInterval = nil | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update the API docs: https://github.com/temporalio/api/blob/master/temporal/api/workflow/v1/message.proto#L310-L314
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporalio/api#840