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
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
cc @roycaihw |
f947183
to
6ecd312
Compare
the CI is green now |
6ecd312
to
1d07d30
Compare
/kind bug |
[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 |
thanks. once this merges, can you pick it to the release-1.14 branch with |
In the description: ping fame -> ping frame |
sure, I'll work on this. |
…6-upstream-release-1.14 Automated cherry pick of #78016: fix: failed to close kubelet->API connections on heartbeat
how about kube-proxy which has the name issue. Is there any plan to fix it. |
some commuity discuss on kubernetes/client-go#374 and kubelet's have done this on kubernetes/kubernetes#78016 Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
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 tocloseAllConns
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?:
@liggitt @smarterclayton @lavalamp @roycaihw @jfoy @hzxuzhonghu