mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #39346 from dperny/fix-more-grpc-sizes
Fix more grpc list message sizes
This commit is contained in:
commit
77657ea737
2 changed files with 10 additions and 2 deletions
|
@ -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"
|
||||
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue