Skip to content

Commit

Permalink
increase grpc recv limit
Browse files Browse the repository at this point in the history
Some providers may generate quite large schemas, and the internal
default grpc response size limit is 4MB. 64MB should cover most any use
case, and if we get providers nearing that we may want to consider a
finer-grained API to fetch individual resource schemas.
  • Loading branch information
jbardin committed Apr 2, 2019
1 parent 39ef97b commit 4ec5138
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/grpc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ func (p *GRPCProvider) GetSchema() (resp providers.GetSchemaResponse) {
resp.ResourceTypes = make(map[string]providers.Schema)
resp.DataSources = make(map[string]providers.Schema)

protoResp, err := p.client.GetSchema(p.ctx, new(proto.GetProviderSchema_Request))
// Some providers may generate quite large schemas, and the internal default
// grpc response size limit is 4MB. 64MB should cover most any use case, and
// if we get providers nearing that we may want to consider a finer-grained
// API to fetch individual resource schemas.
const maxRecvSize = 64 << 20
protoResp, err := p.client.GetSchema(p.ctx, new(proto.GetProviderSchema_Request), grpc.MaxRecvMsgSizeCallOption{MaxRecvMsgSize: maxRecvSize})
if err != nil {
resp.Diagnostics = resp.Diagnostics.Append(err)
return resp
Expand Down

0 comments on commit 4ec5138

Please sign in to comment.