-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[question] Clarification on mode=fail
in job spec
#2286
Comments
@BSick7 This seems like a bug. What version of Nomad are you on and can you provide a job that reproduces? |
Nomad versionnomad v0.5.2 Job spec (json)I have scrubbed the docker image used as its private.
|
This PR ensures that the interval specified is not less than 5 seconds. Fixes #2286
So the behavior was "correct" but very unexpected. Your policy was allowing the job to restart 1 time within a zero interval since it started. So every time it would restart it would be in a new interval and get up to one restart. PR linked validates that there is a sane minimum interval. |
@dadgar Does this mean that a job can restart in |
@BSick7 Exactly. So if you had an interval of 5 minutes, mode "fail" and retry count of 3, the task could restart up to 3 times within 5 minutes before we fail it. If you set the interval to something extremely large, it will effectively be the max restarts forever. |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
A job contains a single task group with the following:
If this job fails with exit code 1, it will continue to repeat the task.
Am I misunderstanding the nomad docs or is this expected?
How can I get the desired behavior of allowing only 1 execution (success or failure)?
(tail snippet of job status)
(tail snippet of alloc status of
3cdd82a5
)The text was updated successfully, but these errors were encountered: