-
Notifications
You must be signed in to change notification settings - Fork 765
Add documentation for the jobs failure policy #4676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v1.16
Are you sure you want to change the base?
Changes from all commits
0b197f8
a4b0edb
461c37f
fe83dd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -38,6 +38,7 @@ Parameter | Description | |||||
`repeats` | An optional number of times in which the job should be triggered. If not set, the job runs indefinitely or until expiration. | ||||||
`ttl` | An optional time to live or expiration of the job. Accepts a "point in time" string in the format of RFC3339, Go duration string (calculated from job creation time), or non-repeating ISO8601. | ||||||
`overwrite` | A boolean value to specify if the job can overwrite an existing one with the same name. Default value is `false` | ||||||
`failure_policy` | An optional failure policy for the job. Details of the format are below. If not set, the job is retried up to 3 times with a delay of 1 second between retries. | ||||||
|
||||||
#### schedule | ||||||
`schedule` accepts both systemd timer-style cron expressions, as well as human readable '@' prefixed period strings, as defined below. | ||||||
|
@@ -63,6 +64,39 @@ Entry | Description | Equivalent | |||||
@daily (or @midnight) | Run once a day, midnight | 0 0 0 * * * | ||||||
@hourly | Run once an hour, beginning of hour | 0 0 * * * * | ||||||
|
||||||
#### failure_policy | ||||||
|
||||||
`failure_policy` specifies how the job should handle failures. | ||||||
|
||||||
It can be set to `constant` or `drop`. | ||||||
- The `constant` policy retries the job based on the configuration. | ||||||
- `max_retries` configures how many times the job should be retried. Not setting this makes it retry indefinitely. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if you can set -1 here or 0? If so them would add something like: "-1 denotes an unlimited number of retries, while 0 means the request will not be retried." |
||||||
- `interval` configures the delay between retries. Not setting this makes it retry immediately. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if all these are valid but this is what we say for other retry policies: https://docs.dapr.io/operations/resiliency/policies/retries/retries-overview/#spec-metadata |
||||||
- The `drop` policy drops the job after the first failure, without retrying. | ||||||
|
||||||
##### Example 1 | ||||||
|
||||||
```json | ||||||
{ | ||||||
//... | ||||||
"failure_policy": { | ||||||
"constant": { | ||||||
"max_retries": 3, | ||||||
"interval": "10s" | ||||||
} | ||||||
} | ||||||
} | ||||||
``` | ||||||
##### Example 2 | ||||||
|
||||||
```json | ||||||
{ | ||||||
//... | ||||||
"failure_policy": { | ||||||
"drop": {} | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
### Request body | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.