Skip to content

docs(workflow): clarify RetryPolicy field docstrings - #1204

Open
magic-peach wants to merge 1 commit into
dapr:mainfrom
magic-peach:docs/retry-policy-field-clarification
Open

docs(workflow): clarify RetryPolicy field docstrings#1204
magic-peach wants to merge 1 commit into
dapr:mainfrom
magic-peach:docs/retry-policy-field-clarification

Conversation

@magic-peach

Copy link
Copy Markdown

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

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

This is a docstring-only change with no behavior change, so no test or separate documentation update is needed beyond the docstrings themselves.

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>
@magic-peach
magic-peach requested review from a team as code owners September 10, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant