-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
investigating where to ignore poststop task in alloc health tracker #9548
Conversation
75eb7c9
to
d272803
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.
This looks good, but this code is hard to review. I think poststop hooks just shouldn't affect deployments? If so we should document that and it might simplify things.
client/allochealth/tracker.go
Outdated
if state.State == structs.TaskStatePending { | ||
// Ignore poststop since it will be pending until the main job exists | ||
if (state.State == structs.TaskStatePending) && | ||
t.lifecycleTasks[taskName] != structs.TaskLifecycleHookPoststop { |
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.
Do we ever want to consider poststop hooks as part of a deployment? I don't think so in which case we should probably if poststop { continue }
at the top of this loop? Otherwise I think if this code gets hit after poststop has started its started time will get taken into consideration?
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.
good question! @jazzyfresh @notnoop, I'm very unfamiliar with lifecycle hooks :D
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.
Agreed @schmichael. In both service & batch cases, deployments should watch for everything but the poststop tasks
0342656
to
a9436ba
Compare
* investigating where to ignore poststop task in alloc health tracker * ignore poststop when setting latest start time for allocation * clean up logic * lifecycle: isolate mocks for poststop deployment test * lifecycle: update comments in tracker Co-authored-by: Jasmine Dahilig <jasmine@dahilig.com>
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. |
Ignores poststop jobs pending state when calculating the lastest start time for an allocation
resolves #9361