Skip to content
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

update restart documentation #7603

Merged
merged 3 commits into from
Apr 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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