mirror of
https://github.com/lightningequipment/circuitbreaker.git
synced 2026-08-13 12:33:02 +02:00
run: update max message size for grpc sender/receiver
This commit is contained in:
parent
38858aabb3
commit
c3c5fa8a7e
1 changed files with 12 additions and 0 deletions
12
run.go
12
run.go
|
|
@ -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
|
||||
|
||||
|
|
@ -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()),
|
||||
)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue