Skip to content

Commit 8d8689d

Browse files
authored
Merge pull request moby#2775 from dperny/increase-max-recv-msg
Increase grpc max recv message size
2 parents 7b5833c + 25c6d44 commit 8d8689d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

manager/state/raft/transport/transport.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package transport
44

55
import (
66
"context"
7+
"math"
78
"net"
89
"sync"
910
"time"
@@ -354,6 +355,15 @@ func (t *Transport) dial(addr string) (*grpc.ClientConn, error) {
354355
return net.DialTimeout("tcp", addr, timeout)
355356
}))
356357

358+
// TODO(dperny): this changes the max received message size for outgoing
359+
// client connections. this means if the server sends a message larger than
360+
// this, we will still accept and unmarshal it. i'm unsure what the
361+
// potential consequences are of setting this to be effectively unbounded,
362+
// so after docker/swarmkit#2774 is fixed, we should remove this option
363+
grpcOptions = append(grpcOptions, grpc.WithDefaultCallOptions(
364+
grpc.MaxCallRecvMsgSize(math.MaxInt32),
365+
))
366+
357367
cc, err := grpc.Dial(addr, grpcOptions...)
358368
if err != nil {
359369
return nil, err

0 commit comments

Comments
 (0)