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

Monitoring non-draining node exits #4380

Merged
merged 2 commits into from
Jun 7, 2018
Merged

Monitoring non-draining node exits #4380

merged 2 commits into from
Jun 7, 2018

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Jun 6, 2018

No description provided.

@dadgar dadgar requested a review from nickethier June 6, 2018 17:22
@@ -215,6 +224,7 @@ func (n *Nodes) monitorDrainNode(ctx context.Context, nodeID string, index uint6
msg = Messagef(MonitorMsgLevelInfo, "Node %q has marked all allocations for migration", nodeID)
} else {
msg = Messagef(MonitorMsgLevelInfo, "No drain strategy set for node %s", nodeID)
defer cancel()
Copy link
Member

Choose a reason for hiding this comment

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

Why here and not before the if statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nickethier So by cancelling the shared context we can cancel the alloc watcher goroutine as well. We only want to do that if we have no expectation of allocations ever changing state because of a drain. That is only true in the else statement because the node has no drain strategy set and it never did. In the other case, allocations can still be transitioning.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes I get it now, thanks!

if len(nodes) == 0 {
return false, fmt.Errorf("missing node")
}
nodeID = nodes[0].ID
Copy link
Member

Choose a reason for hiding this comment

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

I think this line and 270 can be removed.

api/nodes.go Outdated
@@ -177,6 +177,14 @@ func (n *Nodes) monitorDrainMultiplex(ctx context.Context, cancel func(),
select {
case outCh <- msg:
case <-ctx.Done():

// If we are exiting but we have a message, attempt to send it
// so we don't loose a message but do not block.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/loose/lose

@dadgar dadgar merged commit 9fd25f1 into master Jun 7, 2018
@dadgar dadgar deleted the b-drain-monitor branch June 7, 2018 00:50
@github-actions
Copy link

github-actions bot commented Mar 2, 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 2, 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