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 #12576
  • Loading branch information
spacewander authored and simotang committed Jun 10, 2021
1 parent 8139dd3 commit 53e04b2
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 53e04b2

Please sign in to comment.