Preserve pending activity next retry delay#11016
Open
spkane31 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Discussed w/ @fretz12 offline. Decision we came to is we need to have a robust way to distinguish between worker originated retry interval overrides and retry policy computer and only set when the retry policy is recomputer. if attempt.CurrentRetryIntervalSource == POLICY {
attempt.CurrentRetryInterval = durationpb.New(interval)
}This allows updates to override next retry delay and extend or shorten the delay. |
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Fixed standalone activity option updates so a pending retry is not delayed when the worker-provided
NextRetryDelayhappens to equal the old retry-policy interval.When recalculating
CurrentRetryIntervalafterUpdateActivityExecutionOptions, the activity now only applies the newly computed policy interval if it shortens the already scheduled retry delay. This preserves the existing retry schedule when a retry-policy update would otherwise move the next attempt later.Added a regression test for the case where:
NextRetryDelay=2mInitialInterval=2mInitialInterval=10mWhy?
#10920 preserved worker-provided
NextRetryDelaywhen it differed from the policy-derived interval, but missed the edge case where the worker delay and old policy interval were equal. In that case, the update path treated the pending retry as policy-derived and recalculated it from the new policy, incorrectly extending the already scheduled retry from 2m to 10m. A retry-policy update should not delay an existing worker-controlled retry.How did you test it?
Potential risks
Minimal, this is still part of our testing push and not released to production.