Skip to content

Commit

Permalink
Fix more grpc list message sizes
Browse files Browse the repository at this point in the history
There are a few more places, apparently, that List operations against
Swarm exist, besides just in the List methods. This increases the max
received message size in those places.

Signed-off-by: Drew Erny <[email protected]>
  • Loading branch information
dperny committed Jun 13, 2019
1 parent 4dc6b21 commit a84a78e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion daemon/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import (
swarmnode "github.com/docker/swarmkit/node"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
)

const swarmDirName = "swarm"
Expand Down Expand Up @@ -402,7 +403,10 @@ func (c *Cluster) Cleanup() {
func managerStats(client swarmapi.ControlClient, currentNodeID string) (current bool, reachable int, unreachable int, err error) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
nodes, err := client.ListNodes(ctx, &swarmapi.ListNodesRequest{})
nodes, err := client.ListNodes(
ctx, &swarmapi.ListNodesRequest{},
grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
)
if err != nil {
return false, 0, 0, err
}
Expand Down
6 changes: 5 additions & 1 deletion daemon/cluster/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
swarmnode "github.com/docker/swarmkit/node"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
)

// Init initializes new cluster from user provided request.
Expand Down Expand Up @@ -452,7 +453,10 @@ func (c *Cluster) Info() types.Info {

info.Cluster = &swarm.ClusterInfo

if r, err := state.controlClient.ListNodes(ctx, &swarmapi.ListNodesRequest{}); err != nil {
if r, err := state.controlClient.ListNodes(
ctx, &swarmapi.ListNodesRequest{},
grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
); err != nil {
info.Error = err.Error()
} else {
info.Nodes = len(r.Nodes)
Expand Down

0 comments on commit a84a78e

Please sign in to comment.