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

Ensure oversized data frames are not written to spdystreams #70999

Merged
merged 1 commit into from Nov 14, 2018

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Nov 13, 2018

What type of PR is this?
/kind bug

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes kubernetes/client-go#460

If the Stdin provided as input implements a WriteTo function, io.Copy uses it to attempt to write the entire buffer to the stream in one call, which results in a data frame that is too large and silently drops the outgoing frame.

Does this PR introduce a user-facing change?:

client-go: fixes sending oversized data frames to spdystreams in remotecommand.NewSPDYExecutor

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 13, 2018
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 13, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 13, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 13, 2018
@liggitt
Copy link
Member Author

liggitt commented Nov 13, 2018

@kubernetes/sig-api-machinery-pr-reviews
/cc @deads2k @caesarxuchao

@liggitt
Copy link
Member Author

liggitt commented Nov 13, 2018

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 13, 2018
@deads2k
Copy link
Contributor

deads2k commented Nov 13, 2018

I think I get it now.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2018
@liggitt
Copy link
Member Author

liggitt commented Nov 13, 2018

/milestone v1.13

@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Nov 13, 2018
@@ -305,6 +316,12 @@ func TestStream(t *testing.T) {
}
}

select {
case <-requestReceived:
case <-time.After(time.Second):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks flaky?

"io"
)

// readerWrapper delegates to an io.Reader so that only the io.Reader interface is implemented.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What interface are you avoiding, and what is the problematic behavior it triggers?

e.g. maybe "readerNoCloser" will be more obvious, but I don't understand why Close() is problematic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoiding passing in a reader that implements WriteTo (linked to the problematic code path in the description)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I didn't read the PR description carefully enough. But future readers of this code won't see it at all, so can you repeat that in the comment here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@liggitt
Copy link
Member Author

liggitt commented Nov 13, 2018

/hold

will address comments

@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 Nov 13, 2018
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2018
@liggitt
Copy link
Member Author

liggitt commented Nov 14, 2018

/hold cancel

added comments and deflaked

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2018
@liggitt
Copy link
Member Author

liggitt commented Nov 14, 2018

/assign @lavalamp

@liggitt liggitt changed the title Ensure oversided data frames are not written to spdystreams Ensure oversized data frames are not written to spdystreams Nov 14, 2018
@liggitt
Copy link
Member Author

liggitt commented Nov 14, 2018

only thing changed was the comment and the unit test timeout, retagging

@liggitt liggitt added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2018
@enj
Copy link
Member

enj commented Nov 14, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit 774f162 into kubernetes:master Nov 14, 2018
@lavalamp
Copy link
Member

/lgtm

Isn't this a bug in the spdystream library? Shouldn't it split up the data?

@liggitt
Copy link
Member Author

liggitt commented Nov 14, 2018

Isn't this a bug in the spdystream library? Shouldn't it split up the data?

I think it's working as intended... they document their impl of Write to mean 1 write == 1 frame. That said, that doesn't play nice with standard io libraries

@liggitt liggitt deleted the oversized-spdystream-frames branch November 15, 2018 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy of 16M+ file to container causes invalid data frame error
5 participants