Skip to content

Commit

Permalink
embed: unlimit the recv msg size of grpc-gateway
Browse files Browse the repository at this point in the history
Ensure the client which access etcd via grpc-gateway won't
be limited by the MaxCallRecvMsgSize. Here we choose the same
default value of etcdcli as grpc-gateway's MaxCallRecvMsgSize.

Fix etcd-io#12576
  • Loading branch information
spacewander committed Jun 3, 2021
1 parent af6f3dc commit 576861e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/embed/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"io/ioutil"
defaultLog "log"
"math"
"net"
"net/http"
"strings"
Expand Down Expand Up @@ -222,6 +223,10 @@ func (sctx *serveCtx) registerGateway(opts []grpc.DialOption) (*gw.ServeMux, err
addr = fmt.Sprintf("%s://%s", network, addr)
}

opts = append(opts, grpc.WithDefaultCallOptions([]grpc.CallOption{
grpc.MaxCallRecvMsgSize(math.MaxInt32),
}...))

conn, err := grpc.DialContext(ctx, addr, opts...)
if err != nil {
return nil, err
Expand Down

0 comments on commit 576861e

Please sign in to comment.