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

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

This comment has been minimized.

Copy link
Contributor

commented May 17, 2019

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.

@mattjmcnaughton

This comment has been minimized.

Copy link
Contributor

commented May 17, 2019

/ok-to-test

@lavalamp

This comment has been minimized.

Copy link
Member

commented May 17, 2019

@gaorong gaorong force-pushed the gaorong:fix-closeAllConns branch 2 times, most recently from f947183 to 6ecd312 May 18, 2019

@gaorong

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2019

the CI is green now

@gaorong gaorong force-pushed the gaorong:fix-closeAllConns branch from 6ecd312 to 1d07d30 May 23, 2019

@liggitt

This comment has been minimized.

Copy link
Member

commented May 23, 2019

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

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

[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

@liggitt

This comment has been minimized.

Copy link
Member

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

20 checks passed

cla/linuxfoundation gaorong authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
@tedyu

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

In the description:

ping fame -> ping frame

@gaorong gaorong deleted the gaorong:fix-closeAllConns branch May 24, 2019

@gaorong

This comment has been minimized.

Copy link
Contributor Author

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.

k8s-ci-robot added a commit that referenced this pull request May 31, 2019
Merge pull request #78281 from gaorong/automated-cherry-pick-of-#7801…
…6-upstream-release-1.14

Automated cherry pick of #78016: fix: failed to close kubelet->API connections on heartbeat
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.