From 4040dac9af0a2b85059fdc14bb9313de005f04d6 Mon Sep 17 00:00:00 2001 From: Injun Song Date: Wed, 23 Oct 2024 16:40:24 +0900 Subject: [PATCH] chore: remove use of gRPC buffer pool This change follows up on #894. It removes the use of the gRPC buffer pool, an experimental feature that will soon be changed in gRPC. This PR ensures #889 compiles successfully. --- internal/benchmark/loader.go | 6 +- .../grpc/experimental/experimental.go | 65 ------------------- vendor/modules.txt | 1 - 3 files changed, 1 insertion(+), 71 deletions(-) delete mode 100644 vendor/google.golang.org/grpc/experimental/experimental.go diff --git a/internal/benchmark/loader.go b/internal/benchmark/loader.go index 117305186..abc835c42 100644 --- a/internal/benchmark/loader.go +++ b/internal/benchmark/loader.go @@ -13,8 +13,6 @@ import ( "go.uber.org/multierr" "golang.org/x/sync/errgroup" - "google.golang.org/grpc" - "google.golang.org/grpc/experimental" "github.com/kakao/varlog/pkg/types" "github.com/kakao/varlog/pkg/varlog" @@ -56,9 +54,7 @@ func NewLoader(cfg loaderConfig) (loader *Loader, err error) { if scli != nil { return scli, nil } - cli, err := varlog.Open(context.TODO(), loader.cid, loader.mraddrs, varlog.WithGRPCDialOptions( - experimental.WithRecvBufferPool(grpc.NewSharedBufferPool()), - )) + cli, err := varlog.Open(context.TODO(), loader.cid, loader.mraddrs) if err != nil { return nil, err } diff --git a/vendor/google.golang.org/grpc/experimental/experimental.go b/vendor/google.golang.org/grpc/experimental/experimental.go deleted file mode 100644 index de7f13a22..000000000 --- a/vendor/google.golang.org/grpc/experimental/experimental.go +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Copyright 2023 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Package experimental is a collection of experimental features that might -// have some rough edges to them. Housing experimental features in this package -// results in a user accessing these APIs as `experimental.Foo`, thereby making -// it explicit that the feature is experimental and using them in production -// code is at their own risk. -// -// All APIs in this package are experimental. -package experimental - -import ( - "google.golang.org/grpc" - "google.golang.org/grpc/internal" -) - -// WithRecvBufferPool returns a grpc.DialOption that configures the use of -// bufferPool for parsing incoming messages on a grpc.ClientConn. Depending on -// the application's workload, this could result in reduced memory allocation. -// -// If you are unsure about how to implement a memory pool but want to utilize -// one, begin with grpc.NewSharedBufferPool. -// -// Note: The shared buffer pool feature will not be active if any of the -// following options are used: WithStatsHandler, EnableTracing, or binary -// logging. In such cases, the shared buffer pool will be ignored. -// -// Note: It is not recommended to use the shared buffer pool when compression is -// enabled. -func WithRecvBufferPool(bufferPool grpc.SharedBufferPool) grpc.DialOption { - return internal.WithRecvBufferPool.(func(grpc.SharedBufferPool) grpc.DialOption)(bufferPool) -} - -// RecvBufferPool returns a grpc.ServerOption that configures the server to use -// the provided shared buffer pool for parsing incoming messages. Depending on -// the application's workload, this could result in reduced memory allocation. -// -// If you are unsure about how to implement a memory pool but want to utilize -// one, begin with grpc.NewSharedBufferPool. -// -// Note: The shared buffer pool feature will not be active if any of the -// following options are used: StatsHandler, EnableTracing, or binary logging. -// In such cases, the shared buffer pool will be ignored. -// -// Note: It is not recommended to use the shared buffer pool when compression is -// enabled. -func RecvBufferPool(bufferPool grpc.SharedBufferPool) grpc.ServerOption { - return internal.RecvBufferPool.(func(grpc.SharedBufferPool) grpc.ServerOption)(bufferPool) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index a18986018..35e528955 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -542,7 +542,6 @@ google.golang.org/grpc/credentials/insecure google.golang.org/grpc/encoding google.golang.org/grpc/encoding/gzip google.golang.org/grpc/encoding/proto -google.golang.org/grpc/experimental google.golang.org/grpc/grpclog google.golang.org/grpc/health google.golang.org/grpc/health/grpc_health_v1