From ed664e79897a8a02cd884cd4b1b925235c64e797 Mon Sep 17 00:00:00 2001 From: fanmin shi Date: Mon, 22 May 2017 16:57:40 -0700 Subject: [PATCH] v3rpc: change grpc max recv size as needed. --- etcdserver/api/v3rpc/grpc.go | 5 ++++- integration/cluster.go | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/etcdserver/api/v3rpc/grpc.go b/etcdserver/api/v3rpc/grpc.go index 88174e3bac24..72297551e4c9 100644 --- a/etcdserver/api/v3rpc/grpc.go +++ b/etcdserver/api/v3rpc/grpc.go @@ -36,8 +36,11 @@ func Server(s *etcdserver.EtcdServer, tls *tls.Config) *grpc.Server { } opts = append(opts, grpc.UnaryInterceptor(newUnaryInterceptor(s))) opts = append(opts, grpc.StreamInterceptor(newStreamInterceptor(s))) - + // set MaxMsgSize be a bit higher than that of MaxRequestBytes bypasses grpc request size check + // and delegates the check to etcd server. + opts = append(opts, grpc.MaxMsgSize(int(s.Cfg.MaxRequestBytes+1024))) grpcServer := grpc.NewServer(opts...) + pb.RegisterKVServer(grpcServer, NewQuotaKVServer(s)) pb.RegisterWatchServer(grpcServer, NewWatchServer(s)) pb.RegisterLeaseServer(grpcServer, NewQuotaLeaseServer(s)) diff --git a/integration/cluster.go b/integration/cluster.go index ab66ab0c0f62..a19003935404 100644 --- a/integration/cluster.go +++ b/integration/cluster.go @@ -61,8 +61,6 @@ const ( basePort = 21000 UrlScheme = "unix" UrlSchemeTLS = "unixs" - - defaultMaxRequestSize ) var (