style: clarify workflow activity retry fields/defaults
- 主要语言
- Python
- 星标
- 272
- 派生
- 152
- PR 合并指标
- 30 天内没有已合并 PR
描述
## Describe the WORKFLOW SDK feature
There are multiple gotchas in the workflow activity retry policies as described below:
```
ACTIVITY_RETRY_POLICY = RetryPolicy(
first_retry_interval=timedelta(seconds=1),
# max_number_of_attempts is the total attempt count, not the retry count
max_number_of_attempts=5,
backoff_coefficient=3,
# Set max_retry_interval else there won't be any retries
max_retry_interval=timedelta(seconds=10),
# DON'T set retry_timeout. If the timeout is hit, the entire workflow fails and the
# final activity isn't executed.
)
```
https://github.com/dapr/python-sdk/blob/main/ext/dapr-ext-workflow/dapr/ext/workflow/retry_policy.py#L26
go-sdk ref https://github.com/dapr/durabletask-go/blob/main/workflow/workflow.go#L147
acceptance criteria:
- [ ] update the field values to sensible defaults if not provided
- [ ] max_number_of_attempts can remain as is, or become deprecated (still supported) and a new field of max_attempts added that will eventuallyyyyy replace this field
- [ ] all field docs strings updated to be clearer on what they do
- [ ] ensure that retries still apply if max_retry_interval is set
- [ ] update retry_timeout to indicate that if this fails then the workflow will fail
## Release Note
RELEASE NOTE: **ADD** Clarify workflow activity retry policies fields and defaults
贡献指南
调研方向
从 ext/dapr-ext-workflow/dapr/ext/workflow/retry_policy.py 中 RetryPolicy 定义附近开始,然后将其字段和默认值与链接的 durabletask-go workflow.go 参考进行比较。更新文档中对字段行为的说明和合理的默认值,按要求保留受支持的字段,使用 max_retry_interval 验证重试,并明确 retry_timeout 失败的后果。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- distributed-systems
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 62/100