diff --git a/website/pages/docs/job-specification/restart.mdx b/website/pages/docs/job-specification/restart.mdx index 62972f2997c..e8c4742ee32 100644 --- a/website/pages/docs/job-specification/restart.mdx +++ b/website/pages/docs/job-specification/restart.mdx @@ -15,8 +15,7 @@ description: The "restart" stanza configures a group's behavior on task failure. /> The `restart` stanza configures a tasks's behavior on task failure. Restarts -happen on the client that is running the task. If specified at the group level, -the configuration will apply to all tasks within the group. +happen on the client that is running the task. ```hcl job "docs" { @@ -29,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: +``` +restart { + interval = "30m" + attempts = 5 + delay = "15s" + mode = "fail" +} +``` + ## `restart` Parameters - `attempts` `(int: )` - Specifies the number of restarts allowed in the