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

Monitor drains from CLI by default but allow detaching #3948

Merged
merged 4 commits into from
Mar 16, 2018

Conversation

schmichael
Copy link
Member

@schmichael schmichael commented Mar 7, 2018

Output from 5c4ffd4:

                Node "274a087e-9bbb-8f84-b415-7d607d364ef6" drain strategy set
                Alloc "2de59faf-f100-fb4f-0732-6fe17acbba9b" marked for migration
                Alloc "2de59faf-f100-fb4f-0732-6fe17acbba9b" draining
                Alloc "2de59faf-f100-fb4f-0732-6fe17acbba9b" status running -> complete
                Alloc "5453a2a3-dbd2-cac3-5927-bf98cac33447" marked for migration
                Alloc "ecc4720b-1736-4a95-3ab6-f7b77d209bf3" marked for migration
                Alloc "5453a2a3-dbd2-cac3-5927-bf98cac33447" draining
                Alloc "ecc4720b-1736-4a95-3ab6-f7b77d209bf3" draining
                Alloc "5453a2a3-dbd2-cac3-5927-bf98cac33447" status running -> complete
                Alloc "ecc4720b-1736-4a95-3ab6-f7b77d209bf3" status running -> complete
                Node "274a087e-9bbb-8f84-b415-7d607d364ef6" drain complete

Original output from 8b7b42c:

Node "41b74037-5310-ad9f-a368-3bcc78fb723f" drain strategy set
Alloc "114e6f07-60a6-bd43-8967-a1822174def5" draining
Alloc "114e6f07-60a6-bd43-8967-a1822174def5" status running -> complete
Alloc "39f14533-ec8c-654c-f719-d265e5385eff" draining
Alloc "4d5c1f00-7662-a2fa-54db-73812370989d" draining
Node "41b74037-5310-ad9f-a368-3bcc78fb723f" drain complete

@schmichael schmichael changed the title [WIP] Monitor drains from CLI by default but allow detaching Monitor drains from CLI by default but allow detaching Mar 14, 2018
Copy link
Contributor

@dadgar dadgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the watcher! Good job!


case !orig.DesiredTransition.ShouldMigrate() && a.DesiredTransition.ShouldMigrate():
// Alloc marked for migration
msg = "draining"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msg = "marked for migration"

// Alloc status has changed; output
msg = fmt.Sprintf("status %s -> %s", orig.ClientStatus, a.ClientStatus)

case !orig.DesiredTransition.ShouldMigrate() && a.DesiredTransition.ShouldMigrate():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a case for the desired status changing and make that message, "draining"

case orig.ClientStatus != a.ClientStatus:
// Alloc status has changed; output
msg = fmt.Sprintf("status %s -> %s", orig.ClientStatus, a.ClientStatus)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a case for NextAllocation != "" and then make the message, "replaced by allocation %q".

Also delay "node complete" after the node has been marked complete to
capture a few more alloc events. There are other ways to implement this
that could trade off correctness for responsiveness as technically a
node is considered drained when all of its allocs have been marked to
stop and not when they've actually stopped (which may not happen for a
long time).
@schmichael schmichael merged commit b2d682b into f-drainv2-node-drainer Mar 16, 2018
@schmichael schmichael deleted the f-drainv2-cli branch March 16, 2018 22:39
@github-actions
Copy link

github-actions bot commented Mar 9, 2023

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 Mar 9, 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.

2 participants