Skip to content

Commit d77f4a6

Browse files
committed
[configgrpc] Revert to third-party compressor for zstd
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
1 parent e4a1f5b commit d77f4a6

File tree

5 files changed

+29
-128
lines changed

5 files changed

+29
-128
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: configgrpc
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Revert the zstd compression for gRPC to the third-party library we were using previously.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [10394]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: We switched back to our compression logic for zstd when a CVE was found on the third-party library we were using. Now that the third-party library has been fixed, we can revert to that one. For end-users, this has no practical effect. The reproducers for the CVE were tested against this patch, confirming we are not reintroducing the bugs.
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [user]

config/configgrpc/configgrpc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"time"
1313

1414
"github.com/mostynb/go-grpc-compression/nonclobbering/snappy"
15+
"github.com/mostynb/go-grpc-compression/zstd"
1516
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
1617
"go.opentelemetry.io/otel"
1718
"google.golang.org/grpc"
@@ -27,7 +28,6 @@ import (
2728
"go.opentelemetry.io/collector/component"
2829
"go.opentelemetry.io/collector/config/configauth"
2930
"go.opentelemetry.io/collector/config/configcompression"
30-
grpcInternal "go.opentelemetry.io/collector/config/configgrpc/internal"
3131
"go.opentelemetry.io/collector/config/confignet"
3232
"go.opentelemetry.io/collector/config/configopaque"
3333
"go.opentelemetry.io/collector/config/configtelemetry"
@@ -426,7 +426,7 @@ func getGRPCCompressionName(compressionType configcompression.Type) (string, err
426426
case configcompression.TypeSnappy:
427427
return snappy.Name, nil
428428
case configcompression.TypeZstd:
429-
return grpcInternal.ZstdName, nil
429+
return zstd.Name, nil
430430
default:
431431
return "", fmt.Errorf("unsupported compression type %q", compressionType)
432432
}

config/configgrpc/configgrpc_benchmark_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010
"testing"
1111

1212
"github.com/mostynb/go-grpc-compression/nonclobbering/snappy"
13+
"github.com/mostynb/go-grpc-compression/zstd"
1314
"google.golang.org/grpc/codes"
1415
"google.golang.org/grpc/encoding"
1516
"google.golang.org/grpc/encoding/gzip"
1617
"google.golang.org/grpc/status"
1718

18-
"go.opentelemetry.io/collector/config/configgrpc/internal"
1919
"go.opentelemetry.io/collector/pdata/plog"
2020
"go.opentelemetry.io/collector/pdata/pmetric"
2121
"go.opentelemetry.io/collector/pdata/ptrace"
@@ -27,7 +27,7 @@ func BenchmarkCompressors(b *testing.B) {
2727

2828
compressors := make([]encoding.Compressor, 0)
2929
compressors = append(compressors, encoding.GetCompressor(gzip.Name))
30-
compressors = append(compressors, encoding.GetCompressor(internal.ZstdName))
30+
compressors = append(compressors, encoding.GetCompressor(zstd.Name))
3131
compressors = append(compressors, encoding.GetCompressor(snappy.Name))
3232

3333
for _, payload := range payloads {

config/configgrpc/internal/zstd.go

Lines changed: 0 additions & 83 deletions
This file was deleted.

config/configgrpc/internal/zstd_test.go

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)