You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 of https://github.com/grpc/grpc-go/blob/master/encoding/gzip/gzip.go (overwrite any previously registered encoders with the same name).
Steps to reproduce
Write a program that uses a specific zstd grpc compressor implementation (that isn't github.com/mostynb/go-grpc-compression/zstd).
Add opentelemetry-collector to that program.
Note that the zstd grpc compressor is now github.com/mostynb/go-grpc-compression/zstd, depending on init() ordering
What did you expect to see?
The programs original grpc compressor should be used.
What did you see instead?
github.com/mostynb/go-grpc-compression/zstd is used instead of the preferred compressor.
What version did you use?
Any version of opentelemetry-collector that uses github.com/mostynb/go-grpc-compression/* should be affected.
Proposed solution mostynb/go-grpc-compression#19 adds "nonclobbering" versions of each compressor. If I were to land that and make a new release, we could change all opentelemetry-collector imports of github.com/mostynb/go-grpc-compression/* to the corresponding github.com/mostynb/go-grpc-compression/nonclobbering/* package.
If you would accept such a change, I will land that PR in github.com/mostynb/go-grpc-compression (reviews of the PR above are welcome too).
The text was updated successfully, but these errors were encountered:
…ering imports (#7966)
**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.
Describe the bug
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 of https://github.com/grpc/grpc-go/blob/master/encoding/gzip/gzip.go (overwrite any previously registered encoders with the same name).
Steps to reproduce
What did you expect to see?
The programs original grpc compressor should be used.
What did you see instead?
github.com/mostynb/go-grpc-compression/zstd is used instead of the preferred compressor.
What version did you use?
Any version of opentelemetry-collector that uses github.com/mostynb/go-grpc-compression/* should be affected.
Proposed solution
mostynb/go-grpc-compression#19 adds "nonclobbering" versions of each compressor. If I were to land that and make a new release, we could change all opentelemetry-collector imports of github.com/mostynb/go-grpc-compression/* to the corresponding github.com/mostynb/go-grpc-compression/nonclobbering/* package.
If you would accept such a change, I will land that PR in github.com/mostynb/go-grpc-compression (reviews of the PR above are welcome too).
The text was updated successfully, but these errors were encountered: