mostynb / go-grpc-compression

go gRPC encoding wrappers for some useful compression algorithms that are not available in google.golang.org/grpc
Apache License 2.0
21 stars 10 forks source link

Avoid clobbering already-registered compressors, for safety #18

Closed jmacd closed 1 year ago

jmacd commented 1 year ago

My company recently had a production incident caused by this library clobbering already-registered encodings which used the settings found in https://github.com/mostynb/go-grpc-compression/pull/17. Since the OpenTelemetry collector depends on this library, when our company internally began using the OpenTelemetry collector core libraries and it changed our zstd settings inadvertently.

We think it would be also prudent to avoid clobbering these registrations by checking for an existing encoding by the same name before registering the new one during the init() functions in this package.

mostynb commented 1 year ago

I am experimenting with another way of doing this that allows both the current and new behaviour. I'll try to have something ready to compare this to tomorrow.

mostynb commented 1 year ago

What do you think of https://github.com/mostynb/go-grpc-compression/pull/19 ?

jmacd commented 1 year ago

Closed in favor of #19. Thanks @mostynb!