You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
Unhandled exception from gRPC for request size #480
When trying to load test the our kubernetes stack by sending thousands of requests to our exposed endpoint I get this error which crashes the Node app:
This is a gRPC thing. By default, gRPC sets a limit on the size of (serialized) messages that can be sent or received. This can be modified with the channel arguments "grpc.max_receive_message_length" and "grpc.max_send_message_length", which are defined here. A value of -1 allows for messages of unlimited size in both cases.
@stephenplusplus@lukesneeringer It seems that logging may be using the google-gax path. would this config in common-grpc apply at all? I don't see google-gax doing anything with the size limits.
constbunyan=require('bunyan');constLB=require('@google-cloud/logging-bunyan');constlb=newLB({projectId: 'a real project id'});constlogger=bunyan.createLogger({name: 'my-service',streams: [lb.stream()]});for(leti=0;i<100;i++){logger.info({buffer: newInt8Array(56150)},'shields at 99%');}
google-gax doesn't set any of these defaults, as far as I know. It should probably just copy the settings in common-grpc.
For now, this should work:
constlb=newLB({projectId: 'a real project id','grpc.max_send_message_length': -1,'grpc.max_receive_message_length': -1,'grpc.initial_reconnect_backoff_ms': 5000});
I think this issue belongs upstream in logging. Or perhaps more generally in all gax based in libraries given that there are known issues that caused us to customize the config in common-grpc. It doesn't make sense that we are using different network config for common-grpc libraries vs. gax based libraries.
Given that there is already case precedent to set max send and receive length is set to be unlimited in google-cloud/common-grpc, I'm fine with setting these defaults in gax.
I'd like to see if this is an important knob to open up to API producers so we can have the default set at client library generation, I'll poll the other languages to see if this is relevant. For now, lets set these in gax.
constlb=newLB({projectId: 'a real project id','grpc.max_send_message_length': -1,'grpc.max_receive_message_length': -1,'grpc.initial_reconnect_backoff_ms': 5000});
Looking at this old issue... gRPC options can be set in the client constructor and will be passed down to gRPC. We had recently some changes related to that in googleapis/gax-nodejs#328. Closing this for now. If grpc options are not passed down to gRPC correctly please create a new issue.
Activity
stephenplusplus commentedon Nov 16, 2017
From @ofrobots on November 13, 2017 23:42
/cc @landrito @lukesneeringer @murgatroid99: Any guesses if this could be an issue in gRPC or in google-gax?
stephenplusplus commentedon Nov 16, 2017
From @murgatroid99 on November 15, 2017 0:4
This is a gRPC thing. By default, gRPC sets a limit on the size of (serialized) messages that can be sent or received. This can be modified with the channel arguments
"grpc.max_receive_message_length"and"grpc.max_send_message_length", which are defined here. A value of-1allows for messages of unlimited size in both cases.stephenplusplus commentedon Nov 16, 2017
From @ofrobots on November 15, 2017 1:58
So it seems that the google-cloud/common-grpc library sets the defaults to:
So, that is already as expected. It would seem that somehow this is not taking effect.
stephenplusplus commentedon Nov 16, 2017
From @ofrobots on November 15, 2017 2:19
@stephenplusplus @lukesneeringer It seems that logging may be using the google-gax path. would this config in common-grpc apply at all? I don't see google-gax doing anything with the size limits.
stephenplusplus commentedon Nov 16, 2017
From @ofrobots on November 15, 2017 4:7
Repro
stephenplusplus commentedon Nov 16, 2017
google-gax doesn't set any of these defaults, as far as I know. It should probably just copy the settings in common-grpc.
For now, this should work:
stephenplusplus commentedon Nov 16, 2017
From @ofrobots on November 15, 2017 18:31
@stephenplusplus that didn't work actually.
I think this issue belongs upstream in logging. Or perhaps more generally in all gax based in libraries given that there are known issues that caused us to customize the config in common-grpc. It doesn't make sense that we are using different network config for common-grpc libraries vs. gax based libraries.
I am going to move this issue to logging for now.
stephenplusplus commentedon Nov 16, 2017
I don't have any rights on this repo, but consider me assigned to this issue.
stephenplusplus commentedon Nov 17, 2017
@landrito @ofrobots @lukesneeringer -- should these defaults be set in GAX or in toolkit?
ofrobots commentedon Nov 17, 2017
@lukesneeringer and @alexander-fenster?
landrito commentedon Nov 17, 2017
Given that there is already case precedent to set max send and receive length is set to be unlimited in google-cloud/common-grpc, I'm fine with setting these defaults in gax.
I'd like to see if this is an important
knobto open up to API producers so we can have the default set at client library generation, I'll poll the other languages to see if this is relevant. For now, lets set these in gax.stephenplusplus commentedon Nov 17, 2017
Since you're here, any head start on where I can make this change?
landrito commentedon Nov 17, 2017
It would be set in this method: https://github.com/googleapis/gax-nodejs/blob/master/lib/grpc.js#L236
@stephenplusplus any idea why this was not fixed by:
stephenplusplus commentedon Nov 17, 2017
I see the same errors even with those setting.
I added a log line here (https://github.com/googleapis/gax-nodejs/blob/0d60fae9b22ac5c53d6eeb45b7ff869ec28ca9c4/lib/grpc.js#L236) and confirmed the grpc settings were recognized by gax:
vchudnov-g commentedon Nov 10, 2018
@alexander-fenster Any updates?
noahdietz commentedon Nov 19, 2018
@alexander-fenster any updates on this issue? Thanks!
jbolinger commentedon Dec 10, 2018
@alexander-fenster Any updates?
landrito commentedon Jan 2, 2019
@alexander-fenster ping.
alexander-fenster commentedon Jan 3, 2019
Looking at this old issue... gRPC options can be set in the client constructor and will be passed down to gRPC. We had recently some changes related to that in googleapis/gax-nodejs#328. Closing this for now. If grpc options are not passed down to gRPC correctly please create a new issue.