hashicorp / hashicorp/go-plugin

dialGRPCConn should default recv/send msg size to max int not max int32

Open
#184 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.1k
Forks
511
Avg merge
22h 47m
Merged PRs (30d)
4

Description

In dialGRPCConn there is code that is clearly intended to remove any default call limits on either sending or receiving data over the resulting GRPC client connection, but as it uses math.MaxInt32 despite the value being of type int I've actually run into this limit :(. Inside of the GRPC library itself, they seem to use `int(^uint(0) >> 1)` in a place to get the maximum possible value... maybe that can be used instead?

https://github.com/hashicorp/go-plugin/blob/56f9791a3f41b119e6f20fc5e1b1729fe0535418/grpc_client.go#L36-L38

ALTERNATIVELY, can GRPCBroker.Dial be given a way to override the grpc.DialOptions? It calls through to dialGRPCConn, but seems to be on of the few places in the library where the grpc.DialOptions are not configurable (whether directly or indirectly). I kind of feel like the _intent_ of this code was actually fine for me, if only it used the correct 64-bit value; but, if there were merely an override, that would be sufficient.

https://github.com/hashicorp/go-plugin/blob/56f9791a3f41b119e6f20fc5e1b1729fe0535418/grpc_broker.go#L367

https://github.com/hashicorp/go-plugin/blob/56f9791a3f41b119e6f20fc5e1b1729fe0535418/grpc_broker.go#L392

https://github.com/hashicorp/go-plugin/blob/56f9791a3f41b119e6f20fc5e1b1729fe0535418/grpc_client.go#L17

(My motivation for this is that there is a 3GB result that comes to me through one of these go-plugin GRPC channels in Avalanche. In case you care, and to provide the reference there to this issue here, that issue is https://github.com/ava-labs/avalanchego/issues/984.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.