-
Notifications
You must be signed in to change notification settings - Fork 490
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?
Lines 36 to 38 in 56f9791
opts = append(opts, | |
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt32)), | |
grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(math.MaxInt32))) |
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.
Line 367 in 56f9791
func (b *GRPCBroker) Dial(id uint32) (conn *grpc.ClientConn, err error) { |
Line 392 in 56f9791
return dialGRPCConn(b.tls, netAddrDialer(addr)) |
Line 17 in 56f9791
func dialGRPCConn(tls *tls.Config, dialer func(string, time.Duration) (net.Conn, error), dialOpts ...grpc.DialOption) (*grpc.ClientConn, error) { |
(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 ava-labs/avalanchego#984.)