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

Fix kubectl drain --timeout option when eviction is used #64378

Merged
merged 1 commit into from Jun 20, 2018

Conversation

Projects
None yet
7 participants
@wrdls
Copy link
Contributor

wrdls commented May 27, 2018

What this PR does / why we need it:
Timeout option of kubectl drain command is currently broken when using eviction to delete pods.

A new timer is made on each for loop iteration which means it gets reset each time a pod is evicted.

Release note:

Fix kubectl drain --timeout option when eviction is used.

@kubernetes/sig-cli-pr-reviews

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented May 27, 2018

@wrdls: Reiterating the mentions to trigger a notification:
@kubernetes/sig-cli-pr-reviews

In response to this:

What this PR does / why we need it:
Timeout option of kubectl drain command is currently broken when using eviction to delete pods.

A new timer is made on each for loop iteration which means it gets reset each time a pod is evicted.

Release note:

Fix kubectl drain --timeout option when eviction is used.

@kubernetes/sig-cli-pr-reviews

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot requested review from dims and eparis May 27, 2018

@wrdls

This comment has been minimized.

Copy link
Contributor Author

wrdls commented May 28, 2018

/assign @mengqiy

@@ -619,7 +620,7 @@ func (o *DrainOptions) evictPods(pods []corev1.Pod, policyGroupVersion string, g
if doneCount == len(pods) {
return nil
}
case <-time.After(globalTimeout):
case <-globalTimeoutCh:

This comment has been minimized.

@yue9944882

yue9944882 May 28, 2018

Member

Does it make any difference with the previous implementation?

This comment has been minimized.

@wrdls

wrdls May 28, 2018

Author Contributor

Yes, in the previous implementation it's basically a timeout per pod.

Run the following code locally and notice it never ends because the timer gets reset on each for loop iteration: https://play.golang.org/p/uq1I8nLx5Af

This comment has been minimized.

@yue9944882

yue9944882 May 28, 2018

Member

The length of time to wait before giving up, zero means infinite

Umm, yes. The timeout here refreshes every time when a pod is successfully evicted which is inconsistent with the docs.

@yue9944882

This comment has been minimized.

Copy link
Member

yue9944882 commented May 28, 2018

/ok-to-test
/lgtm

@yue9944882

This comment has been minimized.

Copy link
Member

yue9944882 commented May 28, 2018

@adohe Ping for approval :)

@wrdls

This comment has been minimized.

Copy link
Contributor Author

wrdls commented May 28, 2018

/test pull-kubernetes-e2e-gce-device-plugin-gpu

@mengqiy

This comment has been minimized.

Copy link
Contributor

mengqiy commented Jun 6, 2018

/lgtm
@wrdls Can you add a test for it?

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Jun 6, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mengqiy, wrdls, yue9944882

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dims

This comment has been minimized.

Copy link
Member

dims commented Jun 9, 2018

/unassign
/uncc

@k8s-ci-robot k8s-ci-robot removed the request for review from dims Jun 9, 2018

@fejta-bot

This comment has been minimized.

Copy link

fejta-bot commented Jun 17, 2018

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented Jun 20, 2018

Automatic merge from submit-queue (batch tested with PRs 64252, 64307, 64163, 64378, 64179). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit e1cc1fc into kubernetes:master Jun 20, 2018

18 checks passed

Submit Queue Queued to run github e2e tests a second time.
Details
cla/linuxfoundation wrdls authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.