Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster: set bigger grpc limit for array requests #38103

Merged
merged 1 commit into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions daemon/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ package cluster // import "github.com/docker/docker/daemon/cluster"
import (
"context"
"fmt"
"math"
"net"
"os"
"path/filepath"
Expand All @@ -67,9 +68,10 @@ const stateFile = "docker-state.json"
const defaultAddr = "0.0.0.0:2377"

const (
initialReconnectDelay = 100 * time.Millisecond
maxReconnectDelay = 30 * time.Second
contextPrefix = "com.docker.swarm"
initialReconnectDelay = 100 * time.Millisecond
maxReconnectDelay = 30 * time.Second
contextPrefix = "com.docker.swarm"
defaultRecvSizeForListResponse = math.MaxInt32 // the max recv limit grpc <1.4.0
)

// NetworkSubnetsProvider exposes functions for retrieving the subnets
Expand Down
5 changes: 4 additions & 1 deletion daemon/cluster/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
gogotypes "github.com/gogo/protobuf/types"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
)

// GetServices returns all services of a managed swarm cluster.
Expand Down Expand Up @@ -67,7 +68,9 @@ func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Serv

r, err := state.controlClient.ListServices(
ctx,
&swarmapi.ListServicesRequest{Filters: filters})
&swarmapi.ListServicesRequest{Filters: filters},
grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
)
if err != nil {
return nil, err
}
Expand Down
5 changes: 4 additions & 1 deletion daemon/cluster/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
types "github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/daemon/cluster/convert"
swarmapi "github.com/docker/swarmkit/api"
"google.golang.org/grpc"
)

// GetTasks returns a list of tasks matching the filter options.
Expand Down Expand Up @@ -53,7 +54,9 @@ func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, erro

r, err = state.controlClient.ListTasks(
ctx,
&swarmapi.ListTasksRequest{Filters: filters})
&swarmapi.ListTasksRequest{Filters: filters},
grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
)
return err
}); err != nil {
return nil, err
Expand Down