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

Implement chunking for gzip encoder in deferredResponseWriter #130264

Open
Tracked by #5116
serathius opened this issue Feb 19, 2025 · 5 comments · May be fixed by #130281
Open
Tracked by #5116

Implement chunking for gzip encoder in deferredResponseWriter #130264

serathius opened this issue Feb 19, 2025 · 5 comments · May be fixed by #130281
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@serathius
Copy link
Contributor

What would you like to be added?

As pointed out in #129334 (comment) existing implementation of deferredResponseWriter assumes a single write when deciding whether gzip encoding is needed. We would extend writes to allow multiple calls to Write.

To support multiple calls to Write and still make an accurate decision about whether to enable gzip encoding, we will need to buffer the response until its size reach the gzip threshold defaultGzipThresholdBytes or Close is called. At that point we can flush the buffer as it's no longer needed.

As a prerequisite to this change we developed a test to validate the current chunking behavior in #130190. As part of this PR we want to flip expectGzip flag to true as part of "two small chunk writes" scenario. Context #130190 (comment)

Why is this needed?

Required to implement response streaming described in https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/5116-streaming-response-encoding#streaming-collections-and-gzip-encoding

Tracked in kubernetes/enhancements#5116

@serathius serathius added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 19, 2025
@k8s-ci-robot k8s-ci-robot added 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 19, 2025
@serathius
Copy link
Contributor Author

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 19, 2025
@serathius
Copy link
Contributor Author

cc @nkeert

@serathius
Copy link
Contributor Author

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 19, 2025
@sftim
Copy link
Contributor

sftim commented Feb 19, 2025

/retitle Implement chunking for gzip encoder in deferredResponseWriter

@k8s-ci-robot k8s-ci-robot changed the title Implement chunking for gzip encoder indeferredResponseWriter Implement chunking for gzip encoder in deferredResponseWriter Feb 19, 2025
@z1cheng
Copy link
Member

z1cheng commented Feb 19, 2025

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants