Skip to content

Commit

Permalink
update restart documentation (#7603)
Browse files Browse the repository at this point in the history
* update `restart` documentation

#7288 added support for task-specific `restart` policy. this PR updates the docs to reflect that.

* added an explicit example of task-specific restart policy

* Update website/pages/docs/job-specification/restart.mdx
  • Loading branch information
cgbaker committed Apr 13, 2020
1 parent aab5233 commit bea9052
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions website/pages/docs/job-specification/restart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: The "restart" stanza configures a group's behavior on task failure.

# `restart` Stanza

<Placement groups={['job', 'group', 'restart']} />

The `restart` stanza configures a group's behavior on task failure. Restarts
<Placement
groups={[
['job', 'group', 'restart'],
['job', 'group', 'task', 'restart']
]}
/>

The `restart` stanza configures a tasks's behavior on task failure. Restarts
happen on the client that is running the task.

```hcl
Expand All @@ -23,6 +28,35 @@ job "docs" {
}
```

If specified at the group level, the configuration is inherited by all
tasks in the group. If present on the task, the policy is merged with
the restart policy from the encapsulating task group.

For example, assuming that the task group restart policy is:
```hcl
restart {
interval = "30m"
attempts = 2
delay = "15s"
mode = "fail"
}
```
and the individual task restart policy is:
```hcl
restart {
attempts = 5
}
```
then the effective restart policy for the task will be:
```hcl
restart {
interval = "30m"
attempts = 5
delay = "15s"
mode = "fail"
}
```

## `restart` Parameters

- `attempts` `(int: <varies>)` - Specifies the number of restarts allowed in the
Expand Down

0 comments on commit bea9052

Please sign in to comment.