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

Upgrade github.com/mostynb/go-grpc-compression and switch to nonclobbering imports #7966

Merged
merged 2 commits into from
Jun 29, 2023
Merged

Upgrade github.com/mostynb/go-grpc-compression and switch to nonclobbering imports #7966

merged 2 commits into from
Jun 29, 2023

Conversation

mostynb
Copy link
Contributor

@mostynb mostynb commented Jun 26, 2023

Description: Switch to grpc encoders that won't override the consumer's previously registered codecs.

Some consumers of this library have registered grpc compressors, and the init() order can cause their compressors to be clobbered by opentelemetry-collector's use of github.com/mostynb/go-grpc-compression, which follows the pattern from the grpc-go library (overwrite any previously registered encoders with the same name).

Version 1.2.0 of github.com/mostynb/go-grpc-compression added so-called "nonclobbering" imports, which only register the codec if there is not already a codec registered with that name. This PR switches to use those.

Link to tracking Issue: #7920

Testing: tests have been added to the upstream library.

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 @mostynb

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.

@mostynb can you add a changelog entry to capture this change?

I suspect it will mostly be a non event for most users, but in case anyone is surprised by their compression options changing, they can reference the changelog to see what changed.

@mostynb
Copy link
Contributor Author

mostynb commented Jun 27, 2023

@mostynb can you add a changelog entry to capture this change?

I suspect it will mostly be a non event for most users, but in case anyone is surprised by their compression options changing, they can reference the changelog to see what changed.

I gave it a try- I hope the formatting is OK.

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 rebasing @mostynb!

config/configgrpc/go.sum Outdated Show resolved Hide resolved
mostynb added 2 commits June 29, 2023 20:17
…ering imports

Some consumers of this library have registered grpc compressors, and the
init() order can cause their compressors to be clobbered by
opentelemetry-collector's use of github.com/mostynb/go-grpc-compression,
which follows the pattern from the grpc-go library (overwrite any
previously registered encoders with the same name).

Version 1.2.0 of github.com/mostynb/go-grpc-compression added so-called
"nonclobbering" imports, which only register the codec if there is not
already a codec registered with that name. This PR switches to use those.

Fixes #7920.
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (c3f70bd) 90.96% compared to head (a43d589) 90.96%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7966   +/-   ##
=======================================
  Coverage   90.96%   90.96%           
=======================================
  Files         300      300           
  Lines       15090    15090           
=======================================
  Hits        13726    13726           
  Misses       1091     1091           
  Partials      273      273           
Impacted Files Coverage Δ
config/configgrpc/configgrpc.go 91.47% <ø> (ø)

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

@codeboten codeboten merged commit f990e99 into open-telemetry:main Jun 29, 2023
@github-actions github-actions bot added this to the next release milestone Jun 29, 2023
@mostynb mostynb deleted the nonclobbering_go_grpc_compression branch June 30, 2023 08:38
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.

2 participants