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 b4e1def commit 5d98f27
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 @@ -24,6 +24,8 @@ import (
"google.golang.org/grpc/grpclog"
)

const grpcOverheadBytes = 512 * 1024

func init() {
grpclog.SetLogger(plog)
}
Expand All @@ -36,8 +38,9 @@ func Server(s *etcdserver.EtcdServer, tls *tls.Config) *grpc.Server {
}
opts = append(opts, grpc.UnaryInterceptor(newUnaryInterceptor(s)))
opts = append(opts, grpc.StreamInterceptor(newStreamInterceptor(s)))

opts = append(opts, grpc.MaxMsgSize(int(s.Cfg.MaxRequestBytes+grpcOverheadBytes)))
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 5d98f27

Please sign in to comment.