-
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
implement alloc runner task restart hook #9869
Conversation
21dbd38
to
401e05f
Compare
288a15d
to
77b4980
Compare
77b4980
to
b6c8537
Compare
Most allocation hooks don't need to know when a single task within the allocation is restarted. The check watcher for group services triggers the alloc runner to restart all tasks, but the alloc runner's `Restart` method doesn't trigger any of the alloc hooks, including the group service hook. The result is that after the first time a check triggers a restart, we'll never restart the tasks of an allocation again. This commit adds a `RunnerTaskRestartHook` interface so that alloc runner hooks can act if a task within the alloc is restarted. The only implementation is in the group service hook, which will force a re-registration of the alloc's services and fix check restarts.
b6c8537
to
b05386e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the warning can be removed from https://www.nomadproject.io/docs/job-specification/check_restart ?
b05386e
to
0ba11e2
Compare
@tgross We see this was flagged as part of the 1.0.3 milestone, but the release notes suggest 1.0.3 is only security fixes. Should we expect this in 1.0.4? |
The 1.0.3 milestone got re-named to 1.0.4 once the 1.0.3 release went out. Because that was a security patch we weren't able to rename the milestone ahead of disclosing it. So this will go out in 1.0.4. |
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. |
Fixes #9176
Most allocation hooks don't need to know when a single task within the
allocation is restarted. The check watcher for group services triggers the
alloc runner to restart all tasks, but the alloc runner's
Restart
methoddoesn't trigger any of the alloc hooks, including the group service hook. The
result is that after the first time a check triggers a restart, we'll never
restart the tasks of an allocation again.
This commit adds a
RunnerTaskRestartHook
interface so that alloc runnerhooks can act if a task within the alloc is restarted. The only implementation
is in the group service hook, which will force a re-registration of the
alloc's services and fix check restarts.