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
Support cancelable SPDY executor stream #103177
Support cancelable SPDY executor stream #103177
Conversation
Hi @arkbriar. 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. |
/assign @deads2k |
/triage accepted |
/assign @liggitt |
staging/src/k8s.io/client-go/tools/remotecommand/remotecommand.go
Outdated
Show resolved
Hide resolved
should the context plumbed down to the spdy request too? |
@aojea For stream executor interface, it's enough to have a context here. |
I was trying to understand if this could also fix kubernetes/kubectl#686 , but I think I was wrong, and the spdy and Dialer context are not really needed here as you correctly pointed out. Feel free to discard my comment since the Dialer seems to be used also in another places and changing the signature can break some external users, and this will unnecessary complicate this, sorry 😅
/ok-to-test |
8dd91cf
to
b7e6c23
Compare
/retest-required |
1 similar comment
/retest-required |
/lgtm |
thanks for all the iterations on this |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: arkbriar, 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 |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
* Replace `pointer.StringPtr` with `pointer.String` * Replace `pointer.BoolPtr` with `pointer.Bool` * Replace `pointer.Int32Ptr` with `pointer.Int32` * Replace `pointer.Int64Ptr` with `pointer.Int64` * Replace deprecated `sets.String` usages appropriately * Replace `io/ioutil.ReadAll` with `io.ReadAll` As of Go 1.16, this function simply calls `io.ReadAll`. * Use `executor.StreamWithContext` instead of `executor.Stream` kubernetes/kubernetes#103177 * Use dedicated schemes for tests
golangci reported: tests/e2e/helpers/exec.go:49:9 staticcheck SA1019: exec.Stream is deprecated: use StreamWithContext instead to avoid possible resource leaks. See kubernetes/kubernetes#103177 for details. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
golangci reported: tests/e2e/helpers/exec.go:49:9 staticcheck SA1019: exec.Stream is deprecated: use StreamWithContext instead to avoid possible resource leaks. See kubernetes/kubernetes#103177 for details. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
golangci reported: tests/e2e/helpers/exec.go:49:9 staticcheck SA1019: exec.Stream is deprecated: use StreamWithContext instead to avoid possible resource leaks. See kubernetes/kubernetes#103177 for details. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
* Replace `pointer.StringPtr` with `pointer.String` * Replace `pointer.BoolPtr` with `pointer.Bool` * Replace `pointer.Int32Ptr` with `pointer.Int32` * Replace `pointer.Int64Ptr` with `pointer.Int64` * Replace deprecated `sets.String` usages appropriately * Replace `io/ioutil.ReadAll` with `io.ReadAll` As of Go 1.16, this function simply calls `io.ReadAll`. * Use `executor.StreamWithContext` instead of `executor.Stream` kubernetes/kubernetes#103177 * Use dedicated schemes for tests
greate job |
What type of PR is this?
/kind bug
/kind feature
What this PR does / why we need it:
Sometimes I find that even simple command like "echo something" will hang there forever when there're lots of SPDY executor streams running. In the last case, I've examined all the call stacks with debug tool and still haven't figured out why. It seems all of the streams stuck on waiting for next frame and the TCP connections were still alive then. But these streams had already been existed for over 10 minutes.
Anyway, I think it will be reasonable if some bad streams can be canceled to avoid resource leaks. So I just enhance the
remotecommand.Executor
interface with a method accepts a context to support cancelable SPDY executor stream.Also test have been modified to ensure it works.
Which issue(s) this PR fixes:
Fixes kubernetes/client-go#884
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: