-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
Closed
Milestone
Description
Expected behavior
when stream id is Integer.MAX_VALUE, DefaultHttp2Connection.DefaultEndpoint#lastStreamCreated is expected to return Integer.MAX_VALUE

Actual behavior
DefaultHttp2Connection.DefaultEndpoint#lastStreamCreatedreturn 0io.netty.handler.codec.http2.StreamBufferingEncoder#isExistingStreamreturn false- StreamBufferingEncoder write data frame failed
- the further problem is that grpc-java does not handle this write data failure in NettyClientStream
.this result to the grpc client thread hangs forever is we use grpc blocking stub
Steps to reproduce
add the following test case to io.netty.handler.codec.http2.StreamBufferingEncoderTest
@Test
public void testExhaustedStreamId() throws Http2Exception {
int nextStreamId = Integer.MAX_VALUE - 2;
testStreamId(nextStreamId);
nextStreamId = connection.local().incrementAndGetNextStreamId();
testStreamId(nextStreamId);
}
private void testStreamId(int nextStreamId) throws Http2Exception {
connection.local().createStream(nextStreamId, false);
ByteBuf data = data();
ChannelFuture channelFuture = encoder.writeData(ctx, nextStreamId, data, 0, false, newPromise());
if (channelFuture.cause() != null) {
channelFuture.cause().printStackTrace();
}
assertTrue(channelFuture.cause() == null);
}
Minimal yet complete reproducer code (or URL to code)
Netty version
any support http2
JVM version (e.g. java -version)
1.8
OS version (e.g. uname -a)
luowenlong12345 and zxiang179
Metadata
Metadata
Assignees
Labels
No labels