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 23, 2017
1 parent 519a8ab commit 1180f25
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 1180f25

Please sign in to comment.