docs(workflow): clarify RetryPolicy field docstrings - #1204
Open
magic-peach wants to merge 1 commit into
Open
Conversation
Users kept tripping over the same three gotchas: max_number_of_attempts counts the first attempt too, an unset max_retry_interval leaves the backoff interval uncapped rather than disabling retries, and hitting retry_timeout ends retries with whatever the last attempt returned instead of running one more attempt. Spell all three out in the docstrings instead of leaving them to be discovered the hard way. Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
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.
Description
RetryPolicy's docstrings did not explain three behaviors that are easy to get wrong: max_number_of_attempts counts the first attempt, not just retries after it; leaving max_retry_interval unset means the backoff interval keeps growing without a cap rather than disabling retries; and hitting retry_timeout ends retries with whatever the last attempt returned, it does not run one more attempt first. This spells all three out in the docstrings. Verified each claim directly against the attempt-counting and timeout-scheduling logic in dapr/ext/workflow/_durabletask/task.py before writing it.
Issue reference
No existing issue tracks this; found while reading the retry policy implementation.
Checklist
This is a docstring-only change with no behavior change, so no test or separate documentation update is needed beyond the docstrings themselves.