-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
9
Issue 1 - Inconsistency between Java doc and actual HttpClient behavior.
HttpResponse java-doc says:
" The body or bodyAsync which retrieve any response body must be called to ensure that the TCP connection can be re-used subsequently, and any response trailers accessed, if they exist, unless it is known that no response body was received."
Particularly for HTTP/2 implementation, if "body" or "bodyAsync" invocation is omitted (even if it is knows that no response) - it causes memory leak, because of Stream will be never deleted.
Issue 2: attempt to invoke "body" causes client blocking.
In case of HTTP1.1 protocol "HttpResponse.body(HttpResponse.asByteArray())" provides proper result (empty array).
In case of HTTP/2 protocol client blocks on "Stream.receiveData" invocation waiting DataFrame.
Processing PUT requests with no returned data HTTP/2 server may not send DataFrame at all. In such case HTTP/2 server sends returned HeadersFrame with END_STREAM flag. HttpClient doesn't have code to process such behavior.
HttpResponse java-doc says:
" The body or bodyAsync which retrieve any response body must be called to ensure that the TCP connection can be re-used subsequently, and any response trailers accessed, if they exist, unless it is known that no response body was received."
Particularly for HTTP/2 implementation, if "body" or "bodyAsync" invocation is omitted (even if it is knows that no response) - it causes memory leak, because of Stream will be never deleted.
Issue 2: attempt to invoke "body" causes client blocking.
In case of HTTP1.1 protocol "HttpResponse.body(HttpResponse.asByteArray())" provides proper result (empty array).
In case of HTTP/2 protocol client blocks on "Stream.receiveData" invocation waiting DataFrame.
Processing PUT requests with no returned data HTTP/2 server may not send DataFrame at all. In such case HTTP/2 server sends returned HeadersFrame with END_STREAM flag. HttpClient doesn't have code to process such behavior.
- duplicates
-
JDK-8170648 Move java.net.http package out of Java SE to incubator namespace
-
- Closed
-