From e86ca9a7851d6adad5d9a9baf0bb24cb0d3301a3 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 28 Aug 2017 21:32:43 +0200 Subject: [PATCH] Bump maximum message size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I’m not entirely sure where exactly we send so large messages (we shouldn’t!), but this fixes things for now. --- grpcutil/grpcutil.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/grpcutil/grpcutil.go b/grpcutil/grpcutil.go index cc3b1b0..129192a 100644 --- a/grpcutil/grpcutil.go +++ b/grpcutil/grpcutil.go @@ -60,7 +60,9 @@ func DialTLS(addr, certFile, keyFile string) (*grpc.ClientConn, error) { RootCAs: roots, Certificates: []tls.Certificate{cert}}) - return grpc.Dial(addr, grpc.WithTransportCredentials(auth)) + return grpc.Dial(addr, + grpc.WithTransportCredentials(auth), + grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(512*1024*1024))) } func ListenAndServeTLS(addr, certFile, keyFile string, register func(s *grpc.Server)) error { @@ -74,7 +76,10 @@ func ListenAndServeTLS(addr, certFile, keyFile string, register func(s *grpc.Ser return err } - s := grpc.NewServer(grpc.Creds(auth)) + s := grpc.NewServer( + grpc.Creds(auth), + grpc.MaxRecvMsgSize(512*1024*1024), + grpc.MaxSendMsgSize(512*1024*1024)) register(s) -- 2.11.4.GIT