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
feat: enable SPDY pings on connections #97083
feat: enable SPDY pings on connections #97083
Conversation
Question: Is the |
@nielsbasjes I think this is a different problem, because |
Why not enabling it by default as with http/2 #95981 ? kubernetes/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go Lines 93 to 102 in 4332d34
|
7ee03b0
to
281b93e
Compare
flake
/test pull-kubernetes-bazel-test |
/assign @caesarxuchao |
Should |
I guess we'd better not, as |
281b93e
to
c65c4ea
Compare
|
||
"k8s.io/apimachinery/pkg/util/httpstream" | ||
"k8s.io/apimachinery/pkg/util/httpstream/spdy" | ||
restclient "k8s.io/client-go/rest" | ||
) | ||
|
||
// TODO: should we make the period configurable? | ||
const pingPeriod = time.Second * 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 20 second is based on the bug report #94301. People might need a different pingPeriod to satisfy different load balancers.
I think we should expose this variable as a flag of kubectl exec
and kubectl port-forward
commands. That will need approvals from @kubernetes/sig-cli-api-reviews.
I'm ok with hard-code it to 20 seconds for now and make it configurable in a follow-up.
Can you remove the TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the example config for a loadbalancer sets a timeout to 20 seconds having the ping every 20 seconds will most likely cause problems "in the wild". I see this simply as cutting it too close.
I would really prefer a ping interval of something like 5 or 10 seconds because of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote let's hard code to 5s and not make it configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the ping period to 5s.
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
Signed-off-by: Jian Zeng <zengjian.zj@bytedance.com>
c65c4ea
to
d0dce70
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: knight42, lavalamp 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 |
awesome, |
The unit test failure looks real:
|
/retest Review the full test history for this PR. Silence the bot with an |
Signed-off-by: Jian Zeng zengjian.zj@bytedance.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
Enable SPDY pings on connections and the period is set to 5s.
Which issue(s) this PR fixes:
xref #94301
Special notes for your reviewer:
Both
kubectl exec
andkubectl portforward
invokespdy.RoundTripperFor
transitively:kubectl exec
:kubernetes/staging/src/k8s.io/client-go/tools/remotecommand/remotecommand.go
Lines 73 to 74 in e1c617a
kubectl portforward
:kubernetes/staging/src/k8s.io/kubectl/pkg/cmd/portforward/portforward.go
Lines 138 to 139 in e1c617a
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: