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

Add zstd decompression support to HTTPServerSettings #7927

Merged

Conversation

tigrannajaryan
Copy link
Member

This adds ability to decompress zstd-compressed HTTP requests to all receivers that use HTTPServerSettings.

Also added missing error handling for the case when an unsupported compression type was used in the request. Now it correctly returns 400 Bad Request. Also added a unit test to verify this case.

Once this is merged I will submit a PR in contrib repo to add end-to-end tests that use zstd compression in the testbed.

@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/addzstd branch from 0f4aea6 to 2020d10 Compare June 19, 2023 18:43
@tigrannajaryan tigrannajaryan changed the title Add zstd support to HTTPServerSettings Add zstd decompression support to HTTPServerSettings Jun 19, 2023
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/addzstd branch from 2020d10 to ba4ea24 Compare June 19, 2023 18:44
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Patch coverage: 85.00% and project coverage change: -0.01 ⚠️

Comparison is base (25129b7) 91.05% compared to head (2ac04a0) 91.05%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7927      +/-   ##
==========================================
- Coverage   91.05%   91.05%   -0.01%     
==========================================
  Files         298      299       +1     
  Lines       14912    14944      +32     
==========================================
+ Hits        13578    13607      +29     
- Misses       1057     1059       +2     
- Partials      277      278       +1     
Impacted Files Coverage Δ
config/confighttp/compression.go 83.15% <85.00%> (-0.18%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/addzstd branch from ba4ea24 to 2e64b76 Compare June 19, 2023 19:01
@tigrannajaryan tigrannajaryan marked this pull request as ready for review June 19, 2023 19:04
@tigrannajaryan tigrannajaryan requested review from a team and codeboten June 19, 2023 19:04
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Change looks good. Please add a second changelog entry file for the bugfix

@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/addzstd branch from 2e64b76 to a80df15 Compare June 20, 2023 17:07
This adds ability to decompress zstd-compressed HTTP requests to
all receivers that use HTTPServerSettings.

Also added missing error handling for the case when an unsupported
compression type was used in the request. Now it correctly returns
400 Bad Request. Also added a unit test to verify this case.

Once this is merged I will submit a PR in contrib repo to add end-to-end
tests that use zstd compression in the testbed.
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/addzstd branch from a80df15 to f901fda Compare June 20, 2023 17:07
@tigrannajaryan
Copy link
Member Author

Change looks good. Please add a second changelog entry file for the bugfix

Done.

@bogdandrutu
Copy link
Member

Duplicate of #7636?

@bogdandrutu
Copy link
Member

Please look at the other PR and incorporate that change as well.

@tigrannajaryan
Copy link
Member Author

I looked at #7636 and it seems to do 2 additional things:

  1. Adds snapy decompression. I think this can be added in a separate PR.
  2. It closes the request Body after handling the request, which is not necessary (Go docs only require it for clients, not for servers, which is where the confusion probably comes from). However reading the code helped me discover that I did not close zstd Decoder correctly. Fixed now in this commit, so the PR was useful! :-)

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments @tigrannajaryan

@bogdandrutu bogdandrutu merged commit 414dd45 into open-telemetry:main Jun 26, 2023
@github-actions github-actions bot added this to the next release milestone Jun 26, 2023
@tigrannajaryan tigrannajaryan deleted the feature/tigran/addzstd branch June 26, 2023 19:16
codeboten pushed a commit that referenced this pull request Jun 29, 2023
This provides the ability to add support for compression types which are
not supported in core, to be supported by individual components.

This change addresses an issue caused by
#7927,
which prevents receivers that use confighttp from adding support for
their content-encoding types easily. They still can by implementing an
error handler, but that seems messy.

An alternative to this PR is to not return an error for an unsupported
encoding type as was the case before
#7927

If the approach is acceptable, I will add the unit tests and changelog

Signed-off-by: Alex Boten <aboten@lightstep.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants