Skip to content

Commit

Permalink
v3rpc: change grpc max recv size as needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
fanminshi committed May 24, 2017
1 parent 330b3d5 commit e09e6ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion etcdserver/api/v3rpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions integration/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ const (
basePort = 21000
UrlScheme = "unix"
UrlSchemeTLS = "unixs"

defaultMaxRequestSize
)

var (
Expand Down

0 comments on commit e09e6ae

Please sign in to comment.