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

Disable SPDY pings for kubectl cp and add --ping flag for kubectl exec #115493

Closed
wants to merge 1 commit into from

Conversation

brianpursley
Copy link
Member

@brianpursley brianpursley commented Feb 3, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

SPDY pings seem to cause sporadic incomplete file transfer for kubectl cp and kubectl exec.

This PR disables pings for kubectl cp and makes them configurable via a --ping flag for kubectl exec.

Which issue(s) this PR fixes:

Fixes #60140

Special notes for your reviewer:

Further context: #60140 (comment)

Does this PR introduce a user-facing change?

Fixed a bug where using kubectl cp to copy a large file from a remote pod would sometimes result in an incomplete file.
Added --ping flag to allow ping frequency to be configured or disabled for kubectl exec.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 3, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Feb 3, 2023
@brianpursley
Copy link
Member Author

@dims How is this to start with?

I tried to leave the default behavior or spdy.RoundTripperFor() and remotecommand.NewSPDYExecutor() intact, in case someone other than kubectl is depending on that, so I added a couple of new functions for specifying a custom ping period.

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 3, 2023
@brianpursley
Copy link
Member Author

brianpursley commented Feb 3, 2023

What I don't like is that NewSPDYExecutorWithPings() implies that NewSPDYExecutor() doesn't have pings. But that is not the case. NewSPDYExecutor has the default ping period (5 seconds).

Same with RoundTripperWithPingsFor() and RoundTripperFor(). The latter uses the default ping period.

The comments mention the distinction, but the naming seems a little off.

Any recommendations on better naming for these?

@brianpursley
Copy link
Member Author

I can add/update tests, but wanted to see what people think about this change first.

@dims
Copy link
Member

dims commented Feb 3, 2023

@brianpursley naming is hard :) ( https://martinfowler.com/bliki/TwoHardThings.html ) let's see if anyone else comes up with other ideas

@aojea
Copy link
Member

aojea commented Feb 4, 2023

This also solves

cri-o/cri-o#4995
containerd/containerd#5563
#102569

cc: @haircommander @mikebrow

@mikedanese has also some SPDY changes in flight
@soltysh for cli and UX

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 12, 2023
@brianpursley
Copy link
Member Author

Added some tests

@brianpursley brianpursley changed the title WIP:Disable SPDY pings for kubectl cp and add --ping flag for kubectl exec Disable SPDY pings for kubectl cp and add --ping flag for kubectl exec Feb 13, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 13, 2023
@cici37
Copy link
Contributor

cici37 commented Feb 14, 2023

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label May 23, 2023
@brianpursley
Copy link
Member Author

Rebased. Updated help text and log message.

@cici37
Copy link
Contributor

cici37 commented May 30, 2023

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label May 30, 2023
@k8s-ci-robot
Copy link
Contributor

@cici37: Those labels are not set on the issue: sig/api-machinery

In response to this:

/remove-sig api-machinery

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.

@brianpursley
Copy link
Member Author

/hold

@soltysh any thoughts on this PR? It adds a flag, which I know we like to avoid, but it fixes a known problem with kubectl cp.

Also a factor, I know @seans3 is doing some work to switch from spdy to websockets, so I'm not sure if the timeline for that might affect the decision to fix this problem or just wait and see if websockets will fix it.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 30, 2023
@shnkr
Copy link

shnkr commented Aug 14, 2023

@soltysh any thoughts on this PR? It adds a flag, which I know we like to avoid, but it fixes a known problem with kubectl cp.

As someone who had been facing this issue for over a couple of years on off, disabling/enabling/changing interval of pings didn't help much. The latency was one part of the problem which I was able to mitigate but the other part was with various intermediaries. Once in a blue moon, I get to deal with it and every time it's a new environment with a new customer and takes away so much time.

Also a factor, I know @seans3 is doing some work to switch from spdy to websockets, so I'm not sure if the timeline for that might affect the decision to fix this problem or just wait and see if websockets will fix it.

I doubt fix #116778 will solve it completely but time will tell. Otherwise I've been using client<->kubelet leg on websocket without changing kubelet<->runtime leg and it didn't make any difference.

@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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 the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 9, 2023
@dims dims added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 24, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

@Joseph-Goergen
Copy link
Contributor

/reopen

@k8s-ci-robot
Copy link
Contributor

@Joseph-Goergen: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

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.

@mikebrow
Copy link
Member

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Feb 28, 2024
@k8s-ci-robot
Copy link
Contributor

@mikebrow: Reopened this PR.

In response to this:

/reopen

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 the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Feb 28, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: brianpursley
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@leilajal
Copy link
Contributor

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Mar 26, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

@Joseph-Goergen
Copy link
Contributor

/reopen

@k8s-ci-robot
Copy link
Contributor

@Joseph-Goergen: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

kubectl cp fails on large files
10 participants