RFR: 8293786: HttpClient will not send more than 64 kb of data from the 2nd request in http2 [v2]
Conor Cleary
ccleary at openjdk.org
Tue Mar 7 14:48:29 UTC 2023
On Tue, 7 Mar 2023 14:35:49 GMT, Conor Cleary <ccleary at openjdk.org> wrote:
>> test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/http2/Http2TestServerConnection.java line 735:
>>
>>> 733: // isEof() for if END_STREAM has been seen.
>>> 734: // q.size() > 0 for if frames in Queue have not been read.
>>> 735: if (bis instanceof BodyInputStream inputStream && (!inputStream.isEof() || inputStream.q.size() > 0)) {
>>
>> Caught an error with this code here when `bis` is assigned to `NullInputStream.INSTANCE` above. Need to put in an additional check for that.
>
> On review, issue I saw may have been due to using an out of date build while running test tiers and httpclient tests. Will test further but it seems there is no issue. Especially considering the `instanceof` check should be false and the inner code is skipped.
To add on to the explanation given by the in-line comments.
- If an END_STREAM is not seen by the `BodyInputStream`, `bis`, then the client has stopped transmitting for some reason. For example if the sendWindow has been exceeded and the client is waiting for WINDOW_UPDATE frames. This can occur if the InputStream is not fully consumed by the exchange handler too.
- It is possible too that the EOF has been seen but that the `BodyInputStream's` Queue is non empty. This is why an || is used instead of an &&.
Through testing this seems to be the most stable solution, this code usually should only get triggered in test cases including a test handler which does not consume the input stream.
-------------
PR: https://git.openjdk.org/jdk/pull/12694
More information about the net-dev
mailing list