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

kubelet: fix fail to close kubelet->API connections on heartbeat failure #78016

Merged
merged 1 commit into from May 23, 2019

Conversation

gaorong
Copy link
Contributor

@gaorong gaorong commented May 17, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
After #63492, we gain the ability to force close connections on heartbeat failure, when heartbeat failed, we invoke closeAllConns and reestablish new connections. But there is a regression imported by #71174, which assign nil to closeAllConns when bootstrapping or client certificate rotation is disabled. So the broken connection cannot be closed correctly and reused by latter request.
This seems a critical problem because the disconnection to API server can cause cluster-level failure. In an edge case, all nodes turn to NotReady status at the same time.
There are some related issues: kubernetes/client-go#374, #65012.

As discussed in kubernetes/client-go#374, another way to fix this is using http/2.0's ping frame to keep connection alive and identify failed connections. but it seems to be a long-term solution.

Which issue(s) this PR fixes:

Special notes for your reviewer:
the default value of connrotation.NewDialer((&net.Dialer{Timeout: 30 * time.Second, KeepAlive: 30 * time.Second}).DialContext) is 30s. jsut align default value from here and it seems work well for a long time.

related integration test is onging: #77957

Does this PR introduce a user-facing change?:

kubelet: fix fail to close kubelet->API connections on heartbeat failure when bootstrapping or client certificate rotation is disabled

@liggitt @smarterclayton @lavalamp @roycaihw @jfoy @hzxuzhonghu

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 17, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @gaorong. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 17, 2019
@mattjmcnaughton
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 17, 2019
@lavalamp
Copy link
Member

cc @roycaihw

@gaorong gaorong force-pushed the fix-closeAllConns branch 2 times, most recently from f947183 to 6ecd312 Compare May 21, 2019 06:23
@gaorong
Copy link
Contributor Author

gaorong commented May 21, 2019

the CI is green now

@liggitt
Copy link
Member

liggitt commented May 23, 2019

/kind bug
/priority important-soon
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels May 23, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 23, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gaorong, liggitt

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 23, 2019
@liggitt
Copy link
Member

liggitt commented May 23, 2019

thanks. once this merges, can you pick it to the release-1.14 branch with hack/cherry_pick_pull.sh?

@k8s-ci-robot k8s-ci-robot merged commit 1fba888 into kubernetes:master May 23, 2019
@tedyu
Copy link
Contributor

tedyu commented May 23, 2019

In the description:

ping fame -> ping frame

@gaorong gaorong deleted the fix-closeAllConns branch May 24, 2019 04:43
@gaorong
Copy link
Contributor Author

gaorong commented May 24, 2019

thanks. once this merges, can you pick it to the release-1.14 branch with hack/cherry_pick_pull.sh?

sure, I'll work on this.

@chestack
Copy link
Contributor

chestack commented Nov 5, 2019

how about kube-proxy which has the name issue. Is there any plan to fix it.

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. area/kubelet 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants