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

Ensure node drain timeout is respected #2759

Merged
merged 5 commits into from Oct 21, 2020
Merged

Conversation

aclevername
Copy link
Contributor

@aclevername aclevername commented Oct 21, 2020

Description

When draining a node the timeout is not respected. Related issue: #2628. This PR fixes this issue.

Good blog post explaining the issue that was occurring: https://dev.to/julianchu/go-for-select-with-timer-1ah8#timer

Other

I'm questioning the value of the retryDelay, it makes sense to have a delay between attempting to re-drain the same node, but in its current format the retryDelay results in a delay between draining different nodes. I haven't addressed this as part of this PR as its a separate issue, just wanted to raise it.

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the userdocs directory)
  • Manually tested
  • Added labels for change area (e.g. area/nodegroup), target version (e.g. version/0.12.0) and kind (e.g. kind/improvement)
  • Make sure the title of the PR is a good description that can go into the release notes

pending, err := evictPods(drainer, &node)
if err != nil {
logger.Warning("pod eviction error (%q) on node %s – will retry after delay of %s", err, node.Name, retryDelay)
time.Sleep(retryDelay)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this function be refactored? It seems crazy complex to me.
nested for loops + breaks seems like a recipe for these kind of bugs IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants