RFR: 8293786: HttpClient will not send more than 64 kb of data from the 2nd request in http2 [v4]
Conor Cleary
ccleary at openjdk.org
Mon Apr 17 10:31:45 UTC 2023
On Wed, 12 Apr 2023 11:59:59 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
>> Conor Cleary has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8293786: Updated comment in Http2TestServerConnection
>
> test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/Http2TestServerConnection.java line 737:
>
>> 735: // the error code NO_ERROR will be sent to the client before closing.
>> 736: if (bis instanceof BodyInputStream inputStream && (!inputStream.isEof() || inputStream.q.size() > 0)) {
>> 737: bos.sendResetOnClose(ResetFrame.NO_ERROR);
>
> I share @dfuch concern. This line will have no effect if `bos` is already closed at this point. We still need to reset the stream to let the peer know that we won't consume `bis`.
> (edit) To illustrate that, try changing `PostPutTest.TestHandler.handle` to one of:
>
> exchange.sendResponseHeaders(200, -1);
>
> or:
>
> exchange.sendResponseHeaders(200, 0);
> exchange.getResponseBody().close();
>
> it will time out again.
Thanks for the feedback Daniel. I see the issue that my implementation causes if the handler closes the `bos` early. Working on this now as a priority, solution will try to make sure that this RST_STREAM is sent even if the handler looks like the example you gave above. Probably worth inluding these handlers as test cases also.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/12694#discussion_r1168489125
More information about the net-dev
mailing list