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

Support per-task RestartPolicy #7288

Merged
merged 3 commits into from
Mar 24, 2020
Merged

Support per-task RestartPolicy #7288

merged 3 commits into from
Mar 24, 2020

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Mar 7, 2020

Here, we add support for having a per-task RestartPolicy configured by user. With Task Lifecycle coming in the horizon, tasks may need to have different RestartPolicies, e.g. Sidecar or one-off tasks should have different restart policies from main tasks.

In this iteration, the task restart policy inherits and is merged with the TaskGroup it is in, a common Nomad pattern for other stanzas that apply in many levels:

# assuming Task Group restart policy is
restart {
  interval = "30m"
  attempts = 2
  delay    = "15s"
  mode     = "fail"
}

# and individual task group is
restart {
      attempts = 5
}

# then the effective individual task group policy is
restart {
  interval = "30m"
  attempts = 5
  delay    = "15s"
  mode     = "fail"
}

One outstanding question for the Task Lifecycle PR is to whether to have different default policies for one-off or sidecar tasks. It's outside of scope for this PR.

@notnoop notnoop requested a review from jazzyfresh March 7, 2020 15:08
@notnoop notnoop self-assigned this Mar 7, 2020
@notnoop notnoop force-pushed the f-task-restart-policy branch from 3e49178 to 55db937 Compare March 24, 2020 21:01
@notnoop notnoop merged commit b807491 into master Mar 24, 2020
@notnoop notnoop deleted the f-task-restart-policy branch March 24, 2020 22:33
@notnoop notnoop mentioned this pull request Mar 25, 2020
cgbaker added a commit that referenced this pull request Apr 2, 2020
#7288 added support for task-specific `restart` policy. this PR updates the docs to reflect that.
cgbaker added a commit that referenced this pull request Apr 13, 2020
#7288 added support for task-specific `restart` policy. this PR updates the docs to reflect that.
cgbaker added a commit that referenced this pull request Apr 13, 2020
* 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
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants