You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add documentation for the jobs failure policy (#4676)
* chore: Add documentation for the jobs failure policy
Signed-off-by: Albert Callarisa <[email protected]>
* Clarify default failure policy and implications of unsetting fields in the constant policy
Signed-off-by: Albert Callarisa <[email protected]>
* Addressed some grammar suggestions
Signed-off-by: Albert Callarisa <[email protected]>
* Apply suggestions from code review
Co-authored-by: Alice Gibbons <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
* Specified `nil` and `0` values for max_retries
Signed-off-by: Albert Callarisa <[email protected]>
---------
Signed-off-by: Albert Callarisa <[email protected]>
Signed-off-by: Albert Callarisa <[email protected]>
Co-authored-by: Mark Fussell <[email protected]>
Co-authored-by: Alice Gibbons <[email protected]>
Copy file name to clipboardExpand all lines: daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ weight: 2000
6
6
description: "Learn more about the Dapr Jobs features and concepts"
7
7
---
8
8
9
-
Now that you've learned about the [jobs building block]({{< ref jobs-overview.md >}}) at a high level, let's deep dive
9
+
Now that you've learned about the [jobs building block]({{< ref jobs-overview.md >}}) at a high level, let's deep dive
10
10
into the features and concepts included with Dapr Jobs and the various SDKs. Dapr Jobs:
11
11
- Provides a robust and scalable API for scheduling operations to be triggered in the future.
12
12
- Exposes several capabilities which are common across all supported languages.
@@ -15,19 +15,19 @@ into the features and concepts included with Dapr Jobs and the various SDKs. Dap
15
15
16
16
## Job identity
17
17
18
-
All jobs are registered with a case-sensitive job name. These names are intended to be unique across all services
19
-
interfacing with the Dapr runtime. The name is used as an identifier when creating and modifying the job as well as
18
+
All jobs are registered with a case-sensitive job name. These names are intended to be unique across all services
19
+
interfacing with the Dapr runtime. The name is used as an identifier when creating and modifying the job as well as
20
20
to indicate which job a triggered invocation is associated with.
21
21
22
-
Only one job can be associated with a name at any given time. By default, any attempt to create a new job using the same name as an existing job results in an error. However, if the `overwrite` flag is set to `true`, the new job overwrites the existing job with the same name.
22
+
Only one job can be associated with a name at any given time. By default, any attempt to create a new job using the same name as an existing job results in an error. However, if the `overwrite` flag is set to `true`, the new job overwrites the existing job with the same name.
23
23
24
24
## Scheduling Jobs
25
25
A job can be scheduled using any of the following mechanisms:
26
26
- Intervals using Cron expressions, duration values, or period expressions
27
27
- Specific dates and times
28
28
29
-
For all time-based schedules, if a timestamp is provided with a time zone via the RFC3339 specification, that
30
-
time zone is used. When not provided, the time zone used by the server running Dapr is used.
29
+
For all time-based schedules, if a timestamp is provided with a time zone via the RFC3339 specification, that
30
+
time zone is used. When not provided, the time zone used by the server running Dapr is used.
31
31
In other words, do **not** assume that times run in UTC time zone, unless otherwise specified when scheduling
32
32
the job.
33
33
@@ -47,7 +47,7 @@ fields spanning the values specified in the table below:
47
47
48
48
### Schedule using a duration value
49
49
You can schedule jobs using [a Go duration string](https://pkg.go.dev/time#ParseDuration), in which
50
-
a string consists of a (possibly) signed sequence of decimal numbers, each with an optional fraction and a unit suffix.
50
+
a string consists of a (possibly) signed sequence of decimal numbers, each with an optional fraction and a unit suffix.
51
51
Valid time units are `"ns"`, `"us"`, `"ms"`, `"s"`, `"m"`, or `"h"`.
52
52
53
53
#### Example 1
@@ -69,7 +69,7 @@ The following period expressions are supported. The "@every" expression also acc
69
69
|@hourly| Run once an hour at the beginning of the hour | 0 0 * * * * |
70
70
71
71
### Schedule using a specific date/time
72
-
A job can also be scheduled to run at a particular point in time by providing a date using the
72
+
A job can also be scheduled to run at a particular point in time by providing a date using the
Copy file name to clipboardExpand all lines: daprdocs/content/en/reference/api/jobs_api.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ Parameter | Description
38
38
`repeats` | An optional number of times in which the job should be triggered. If not set, the job runs indefinitely or until expiration.
39
39
`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.
40
40
`overwrite` | A boolean value to specify if the job can overwrite an existing one with the same name. Default value is `false`
41
+
`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.
41
42
42
43
#### schedule
43
44
`schedule` accepts both systemd timer-style cron expressions, as well as human readable '@' prefixed period strings, as defined below.
@daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
64
65
@hourly | Run once an hour, beginning of hour | 0 0 * * * *
65
66
67
+
#### failure_policy
68
+
69
+
`failure_policy` specifies how the job should handle failures.
70
+
71
+
It can be set to `constant` or `drop`.
72
+
- The `constant` policy retries the job constantly with the following configuration options.
73
+
-`max_retries` configures how many times the job should be retried. Defaults to retrying indefinitely. `nil` denotes unlimited retries, while `0` means the request will not be retried.
74
+
-`interval` configures the delay between retries. Defaults to retrying immediately. Valid values are of the form `200ms`, `15s`, `2m`, etc.
75
+
- The `drop` policy drops the job after the first failure, without retrying.
0 commit comments