Skip to content

[Bug Fix] Allow Status Updates for Pods that can be deleted#42779

Merged
dchen1107 merged 1 commit into
kubernetes:masterfrom
dashpole:fix_status
Mar 9, 2017
Merged

[Bug Fix] Allow Status Updates for Pods that can be deleted#42779
dchen1107 merged 1 commit into
kubernetes:masterfrom
dashpole:fix_status

Conversation

@dashpole

@dashpole dashpole commented Mar 9, 2017

Copy link
Copy Markdown
Contributor

Fixes #42685 (comment) (at least part of it), #42776.

Running e2e node garbage collection tests on this. Ill report in when I have results.

In the meantime, please review the change.

cc @yujuhong @dchen1107 @derekwaynecarr

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 9, 2017
@k8s-reviewable

Copy link
Copy Markdown

This change is Reviewable

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Mar 9, 2017
@dashpole

dashpole commented Mar 9, 2017

Copy link
Copy Markdown
Contributor Author

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Mar 9, 2017
@dashpole

dashpole commented Mar 9, 2017

Copy link
Copy Markdown
Contributor Author

7 runs (of all 3 BC tests) without a flake. Ill do another run, but I am seeing consistent deletion times of around 30 seconds.

Comment thread pkg/kubelet/status/status_manager.go Outdated
// syncPod syncs the given status with the API server. The caller must not hold the lock.
func (m *manager) syncPod(uid types.UID, status versionedPodStatus) {
if !m.needsUpdate(uid, status) {
if !m.needsUpdate(uid, status) && !m.couldBeDeleted(uid, status.status) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add a comments explains the logic?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@dashpole

dashpole commented Mar 9, 2017

Copy link
Copy Markdown
Contributor Author

another 6 runs without a flake.

@feiskyer

feiskyer commented Mar 9, 2017

Copy link
Copy Markdown
Member

/assign @yujuhong @dchen1107 @derekwaynecarr

Comment thread pkg/kubelet/status/status_manager.go Outdated
func (m *manager) syncPod(uid types.UID, status versionedPodStatus) {
if !m.needsUpdate(uid, status) {
// always allow status updates if the pod can be deleted.
if !m.needsUpdate(uid, status) && !m.couldBeDeleted(uid, status.status) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is still fragile since you have to keep the code at two places in sync. Maybe add another method dedicated for the check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What about moving it inside needsUpdate? Then it would only be in one place.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SGTM.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@yujuhong yujuhong self-assigned this Mar 9, 2017
@yujuhong yujuhong added this to the v1.6 milestone Mar 9, 2017
@smarterclayton

Copy link
Copy Markdown
Contributor

/approve

Given comments in issue and that it is a bug

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2017
@yujuhong

yujuhong commented Mar 9, 2017

Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2017
@dchen1107

Copy link
Copy Markdown
Member

/lgtm

@dashpole Can you also introduce a pod deletion test to node e2e? I observed a lot of deletion regression lately. Hope the test can help us to catch the regression earlier. Thanks!

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@dchen1107: you can't LGTM a PR unless you are an assignee.

Details

In response to this comment:

/lgtm

@dashpole Can you also introduce a pod deletion test to node e2e? I observed a lot of deletion regression lately. Hope the test can help us to catch the regression earlier. Thanks!

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. I understand the commands that are listed here.

@k8s-github-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

The following people have approved this PR: dashpole, dchen1107, smarterclayton, yujuhong

Needs approval from an approver in each of these OWNERS Files:

We suggest the following people:
cc @derekwaynecarr
You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@yujuhong

yujuhong commented Mar 9, 2017

Copy link
Copy Markdown
Contributor

@k8s-bot bazel test this

@dashpole

dashpole commented Mar 9, 2017

Copy link
Copy Markdown
Contributor Author

@k8s-bot cvm gce e2e test this

@ethernetdan ethernetdan added the kind/bug Categorizes issue or PR as related to a bug. label Mar 9, 2017
@dashpole dashpole changed the title [Bug Fix] Allow deletion of pods that can be deleted. [Bug Fix] Allow Status Updates for Pods that can be deleted Mar 9, 2017
@dashpole

dashpole commented Mar 9, 2017

Copy link
Copy Markdown
Contributor Author

I ran another set of GC tests on the latest version of this PR just as a sanity check. It passed.

@dchen1107

Copy link
Copy Markdown
Member

All tests are passed. I plan to manually merge this to stop the bleeding submit-queue in 5 mins. Of course there are other flakiness.

@dchen1107 dchen1107 merged commit 69eaea2 into kubernetes:master Mar 9, 2017
@dashpole dashpole deleted the fix_status branch March 9, 2017 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants