Skip to content

Commit

Permalink
run: update max message size for grpc sender/receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
carlaKC committed Oct 23, 2023
1 parent 38858aa commit c3c5fa8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ import (

var errUserExit = errors.New("user requested termination")

// maxGrpcMsgSize is used when we configure both server and clients to allow sending and
// receiving at most 32 MB GRPC messages.
//
// This value is based on the default number of forwarding history entries that we'll
// store in the database, as this is the largest query we currently make (~13 MB of data)
// plus some leeway for nodes that override this default to a larger value.
const maxGrpcMsgSize = 32 * 1024 * 1024

//go:embed all:webui-build
var content embed.FS

Expand Down Expand Up @@ -93,6 +101,7 @@ func run(c *cli.Context) error {
p := NewProcess(client, log, limits, db)

grpcServer := grpc.NewServer(
grpc.MaxRecvMsgSize(maxGrpcMsgSize),
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer()),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer()),
)
Expand All @@ -117,6 +126,9 @@ func run(c *cli.Context) error {
ctx,
listenAddress,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(maxGrpcMsgSize),
),
)
if err != nil {
return err
Expand Down

0 comments on commit c3c5fa8

Please sign in to comment.