Error: Caused by: io.netty.handler.codec.http2.Http2Exception: Window size overflow for stream: 0

别说谁变了你拦得住时间么 提交于 2021-01-05 13:02:12

问题


Error while calling a remote machine using grpc witout ssl. On first execution, works fine. On second client execution, the error occurs.

On client side I'm open and close a channel on each request like that:

channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build();
stub = ApiServiceGrpc.newBlockingStub(channel);
stub.CreateRequest(request);
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);

Server side:

    "io.grpc:grpc-protobuf:1.23.0"
    "io.grpc:grpc-stub:1.23.0"
    "io.grpc:grpc-okhttp:1.23.0"
server = NettyServerBuilder
                .forAddress(new InetSocketAddress("0.0.0.0", port))
                .addService(myService)
                .build()
                .start();

This is the client Log using finest configuration to log I tried to use everything as default, no customizations: Using io.grpc:grpc-all:1.23.0

Logs: Success Execution

Server
2020-03-05 09:51:53,818 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] OUTBOUND SETTINGS: ack=false settings={MAX_CONCURRENT_STREAMS=2147483647, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
2020-03-05 09:51:53,842 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] OUTBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
2020-03-05 09:51:53,864 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] INBOUND SETTINGS: ack=false settings={HEADER_TABLE_SIZE=4096, ENABLE_PUSH=0, MAX_CONCURRENT_STREAMS=0, INITIAL_WINDOW_SIZE=1048576, MAX_FRAME_SIZE=16384, MAX_HEADER_LIST_SIZE=8192}
2020-03-05 09:51:53,866 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] OUTBOUND SETTINGS: ack=true
2020-03-05 09:51:53,868 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=2147418112
2020-03-05 09:51:53,869 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] INBOUND SETTINGS: ack=true
2020-03-05 09:51:53,917 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] INBOUND HEADERS: streamId=3 headers=GrpcHttp2RequestHeaders[:path: /service.KongApiService/CreateConfig, :authority: machine_02:12577, :method: POST, :scheme: http, te: trailers, content-type: application/grpc, user-agent: grpc-java-netty/1.23.0, grpc-accept-encoding: gzip] streamDependency=0 weight=16 exclusive=false padding=0 endStream=false
2020-03-05 09:51:53,945 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] INBOUND DATA: streamId=3 padding=0 endStream=true length=276 bytes=000000010f0a0a636f6e6669674e616d65120a636f6e6669674e616d651a0a636f6e6669674e616d65220a636f6e6669674e616d652a0a636f6e6669674e616d...
2020-03-05 09:51:53,995 INFO  [grpc-default-executor-0|c.c.s.k.g.KongApiService] Create/Replace configuration: configName
2020-03-05 09:51:54,008 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] OUTBOUND HEADERS: streamId=3 headers=GrpcHttp2OutboundHeaders[:status: 200, content-type: application/grpc, grpc-encoding: identity, grpc-accept-encoding: gzip] streamDependency=0 weight=16 exclusive=false padding=0 endStream=false
2020-03-05 09:51:54,021 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] OUTBOUND DATA: streamId=3 padding=0 endStream=false length=276 bytes=000000010f0a0a636f6e6669674e616d65120a636f6e6669674e616d651a0a636f6e6669674e616d65220a636f6e6669674e616d652a0a636f6e6669674e616d...
2020-03-05 09:51:54,024 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] OUTBOUND HEADERS: streamId=3 headers=GrpcHttp2OutboundHeaders[grpc-status: 0] streamDependency=0 weight=16 exclusive=false padding=0 endStream=true
2020-03-05 09:51:54,057 DEBUG [grpc-nio-worker-ELG-3-1|i.g.n.NettyServerHandler] [id: 0x623f6427, L:/10.0.0.2:12577 - R:/10.0.0.3:51022] INBOUND GO_AWAY: lastStreamId=0 errorCode=0 length=0 bytes=
Client
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] OUTBOUND SETTINGS: ack=false settings={ENABLE_PUSH=0, MAX_CONCURRENT_STREAMS=0, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] OUTBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] INBOUND SETTINGS: ack=false settings={HEADER_TABLE_SIZE=4096, MAX_CONCURRENT_STREAMS=100, INITIAL_WINDOW_SIZE=1048576, MAX_FRAME_SIZE=16384, MAX_HEADER_LIST_SIZE=8192}
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] OUTBOUND SETTINGS: ack=true
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=2147418112
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] INBOUND SETTINGS: ack=true
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] OUTBOUND HEADERS: streamId=3 headers=GrpcHttp2OutboundHeaders[:authority: machine_02:12577, :path: /service.KongApiService/CreateConfig, :method: POST, :scheme: http, content-type: application/grpc, te: trailers, user-agent: grpc-java-netty/1.23.0, grpc-accept-encoding: gzip] streamDependency=0 weight=16 exclusive=false padding=0 endStream=false
Mar 05, 2020 9:51:51 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] OUTBOUND DATA: streamId=3 padding=0 endStream=true length=276 bytes=000000010f0a0a636f6e6669674e616d65120a636f6e6669674e616d651a0a636f6e6669674e616d65220a636f6e6669674e616d652a0a636f6e6669674e616d...
Mar 05, 2020 9:51:52 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] INBOUND HEADERS: streamId=3 headers=GrpcHttp2ResponseHeaders[:status: 200, content-type: application/grpc, grpc-encoding: identity, grpc-accept-encoding: gzip] streamDependency=0 weight=16 exclusive=false padding=0 endStream=false
Mar 05, 2020 9:51:52 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] INBOUND DATA: streamId=3 padding=0 endStream=false length=276 bytes=000000010f0a0a636f6e6669674e616d65120a636f6e6669674e616d651a0a636f6e6669674e616d65220a636f6e6669674e616d652a0a636f6e6669674e616d...
Mar 05, 2020 9:51:52 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] INBOUND HEADERS: streamId=3 headers=GrpcHttp2ResponseHeaders[grpc-status: 0] streamDependency=0 weight=16 exclusive=false padding=0 endStream=true
Mar 05, 2020 9:51:52 AM io.grpc.netty.NettyClientHandler close FINE: Network channel being closed by the application.
Mar 05, 2020 9:51:52 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x1e2d0467, L:/10.0.0.3:51022 - R:machine_02/10.0.0.2:12577] OUTBOUND GO_AWAY: lastStreamId=0 errorCode=0 length=0 bytes=
Mar 05, 2020 9:51:52 AM io.grpc.netty.NettyClientHandler channelInactive FINE: Network channel is closed

The second execution. The server still running and the client started again.

Error Execution

Server:
2020-03-05 09:52:57,613 DEBUG [grpc-nio-worker-ELG-3-2|i.g.n.NettyServerHandler] [id: 0x40afc9b8, L:/10.0.0.2:12577 - R:/10.0.0.3:51078] OUTBOUND SETTINGS: ack=false settings={MAX_CONCURRENT_STREAMS=2147483647, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
2020-03-05 09:52:57,617 DEBUG [grpc-nio-worker-ELG-3-2|i.g.n.NettyServerHandler] [id: 0x40afc9b8, L:/10.0.0.2:12577 - R:/10.0.0.3:51078] OUTBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
2020-03-05 09:52:57,640 DEBUG [grpc-nio-worker-ELG-3-2|i.g.n.NettyServerHandler] [id: 0x40afc9b8, L:/10.0.0.2:12577 - R:/10.0.0.3:51078] INBOUND SETTINGS: ack=false settings={HEADER_TABLE_SIZE=4096, ENABLE_PUSH=0, MAX_CONCURRENT_STREAMS=0, INITIAL_WINDOW_SIZE=1048576, MAX_FRAME_SIZE=16384, MAX_HEADER_LIST_SIZE=8192}
2020-03-05 09:52:57,641 DEBUG [grpc-nio-worker-ELG-3-2|i.g.n.NettyServerHandler] [id: 0x40afc9b8, L:/10.0.0.2:12577 - R:/10.0.0.3:51078] OUTBOUND SETTINGS: ack=true
2020-03-05 09:52:57,641 DEBUG [grpc-nio-worker-ELG-3-2|i.g.n.NettyServerHandler] [id: 0x40afc9b8, L:/10.0.0.2:12577 - R:/10.0.0.3:51078] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=2147418112
2020-03-05 09:52:57,658 DEBUG [grpc-nio-worker-ELG-3-2|i.g.n.NettyServerHandler] [id: 0x40afc9b8, L:/10.0.0.2:12577 - R:/10.0.0.3:51078] INBOUND SETTINGS: ack=true
2020-03-05 09:52:57,659 DEBUG [grpc-nio-worker-ELG-3-2|i.g.n.NettyServerHandler] [id: 0x40afc9b8, L:/10.0.0.2:12577 - R:/10.0.0.3:51078] INBOUND GO_AWAY: lastStreamId=0 errorCode=3 length=34 bytes=57696e646f772073697a65206f766572666c6f7720666f722073747265616d3a2030
Client:
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] OUTBOUND SETTINGS: ack=false settings={ENABLE_PUSH=0, MAX_CONCURRENT_STREAMS=0, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] OUTBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] INBOUND SETTINGS: ack=false settings={MAX_CONCURRENT_STREAMS=2147483647, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] OUTBOUND SETTINGS: ack=true
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=983041
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] INBOUND SETTINGS: ack=true
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=2147418112
Mar 05, 2020 9:52:55 AM io.grpc.netty.NettyClientHandler onConnectionError FINE: Caught a connection error  io.netty.handler.codec.http2.Http2Exception: Window size overflow for stream: 0
Mar 05, 2020 9:52:55 AM io.netty.util.internal.logging.AbstractInternalLogger log FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] OUTBOUND GO_AWAY: lastStreamId=0 errorCode=3 length=34 bytes=57696e646f772073697a65206f766572666c6f7720666f722073747265616d3a2030
Mar 05, 2020 9:52:55 AM io.netty.handler.codec.http2.Http2ConnectionHandler processGoAwayWriteResult FINE: [id: 0x56cb1182, L:/10.0.0.3:51078 - R:machine_02/10.0.0.2:12577] Sent GOAWAY: lastStreamId '0', errorCode '3', debugData 'Window size overflow for stream: 0'. Forcing shutdown of the connection.
Mar 05, 2020 9:52:55 AM io.grpc.netty.NettyClientHandler channelInactive FINE: Network channel is closed io.grpc.StatusRuntimeException: INTERNAL: http2 exception


来源:https://stackoverflow.com/questions/60492960/error-caused-by-io-netty-handler-codec-http2-http2exception-window-size-overf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!