Open
Description
Currently, repeatPolicy
only supports fixed intervals between retries. This doesn't handle scenarios where services need progressively longer recovery times.
Design
Add an exponentialBackoff
boolean field to enable exponential backoff behavior:
steps:
- name: check-service
command: curl -f https://api.example.com/health
repeatPolicy:
intervalSec: 1 # Initial interval
limit: 5 # Max attempts
exponentialBackoff: true # Enable exponential backoff
exitCode: [1] # Repeat on failure
Behavior:
- 1st retry: 1s
- 2nd retry: 2s
- 3rd retry: 4s
- 4th retry: 8s
- 5th retry: 16s
Implementation
- Add
ExponentialBackoff bool
toRepeatPolicy
struct in/internal/digraph/step.go
- Update scheduler logic in
/internal/digraph/scheduler/scheduler.go:334
to calculate interval as:interval * (2^retryCount)
- Use existing
node.State().DoneCount
to track retry attempts