gPRC java: 'Window size overflow for stream: 0'

391 Views Asked by At

My gPRC Java client app gets a 'Window size overflow for stream: 0' error. I don't control the server. I have tried using both .newStub() and .newBlockingStub(). My Python client app works successfully with the server so maybe it's a Netty config issue?

Gradle:

compile 'io.grpc:grpc-all:1.32.1'

Channel/stub setup (no error here):

channel = NettyChannelBuilder.forAddress(hostname, port)
.usePlaintext()
.maxInboundMessageSize(32000000)
.build();
blockingStub = AuthenticationServiceGrpc.newBlockingStub(channel);

error when calling method on stub:

15:19:33.563 [grpc-default-executor-0] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
15:19:33.563 [grpc-default-executor-0] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4
15:19:33.568 [grpc-default-executor-0] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkAccessible: true
15:19:33.569 [grpc-default-executor-0] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkBounds: true
15:19:33.569 [grpc-default-executor-0] DEBUG io.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@60485942
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 32
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 32
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.tinyCacheSize: 512
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimIntervalMillis: 0
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: true
15:19:33.612 [grpc-default-executor-0] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
15:19:33.636 [grpc-default-executor-0] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 3628515 (auto-detected)
15:19:33.638 [grpc-default-executor-0] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
15:19:33.638 [grpc-default-executor-0] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
15:19:33.639 [grpc-default-executor-0] DEBUG io.netty.util.NetUtil - Loopback interface: lo (lo, 0:0:0:0:0:0:0:1%lo)
15:19:33.640 [grpc-default-executor-0] DEBUG io.netty.util.NetUtil - /proc/sys/net/core/somaxconn: 128
15:19:33.641 [grpc-default-executor-0] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: 00:0c:29:ff:fe:64:b1:92 (auto-detected)
15:19:33.660 [grpc-default-executor-0] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
15:19:33.661 [grpc-default-executor-0] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0
15:19:33.661 [grpc-default-executor-0] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
15:19:33.676 [grpc-default-executor-0] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 4096
15:19:33.677 [grpc-default-executor-0] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: 2
15:19:33.677 [grpc-default-executor-0] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.linkCapacity: 16
15:19:33.677 [grpc-default-executor-0] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8
15:19:33.677 [grpc-default-executor-0] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.delayedQueue.ratio: 8
15:19:33.704 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] OUTBOUND SETTINGS: ack=false settings={ENABLE_PUSH=0, MAX_CONCURRENT_STREAMS=0, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
15:19:33.713 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] OUTBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
15:19:33.720 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] INBOUND SETTINGS: ack=false settings={MAX_CONCURRENT_STREAMS=2147483647, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
15:19:33.721 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] OUTBOUND SETTINGS: ack=true
15:19:33.722 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
15:19:33.722 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] INBOUND SETTINGS: ack=true
15:19:33.723 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=2147418112
15:19:33.724 [grpc-nio-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] OUTBOUND GO_AWAY: lastStreamId=0 errorCode=3 length=34 bytes=<snip>
15:19:33.726 [grpc-nio-worker-ELG-1-2] DEBUG io.netty.handler.codec.http2.Http2ConnectionHandler - [id: 0x894fae21, L:/10.0.96.48:55684 - R:/208.92.121.158:50051] Sent GOAWAY: lastStreamId '0', errorCode '3', debugData 'Window size overflow for stream: 0'. Forcing shutdown of the connection.
Request to grpc server failed
io.grpc.StatusRuntimeException: INTERNAL: http2 exception
  at io.grpc.Status.asRuntimeException(Status.java:533)
  at io.grpc.stub.ClientCalls$BlockingResponseStream.hasNext(ClientCalls.java:648)
1

There are 1 best solutions below

1
On

If you suspect a Netty config issue you must have experimented with Netty config, right?

Are you using the same gRPC version as the server?

Have you followed the config directives of those who control the server?

P.S. Scala compiles to Java byte code and uses the Java libs.