-
Sub-task
-
Resolution: Fixed
-
P3
-
None
-
None
BodySubscriber.asInputStream() returns an InputStream.
The HttpClient selector manager thread will not exit until pending operations are all completed.
Not reading the input stream may therefore prevent the selector manager thread from exiting, and the HttpClient from being garbage collected until the server eventually times out and closes the connection, as it will appear that some operation is still in progress.
InputStream::close is linked up to Subscription.cancel, but whether the concrete implementation of that method takes the appropriate corrective action if not all bytes have been read should be evaluated: close the connection if HTTP/1.1, reset the stream if HTTP/2.
Also the effect of not reading all data and not closing the stream should probably be documented in an @implNote
The HttpClient selector manager thread will not exit until pending operations are all completed.
Not reading the input stream may therefore prevent the selector manager thread from exiting, and the HttpClient from being garbage collected until the server eventually times out and closes the connection, as it will appear that some operation is still in progress.
InputStream::close is linked up to Subscription.cancel, but whether the concrete implementation of that method takes the appropriate corrective action if not all bytes have been read should be evaluated: close the connection if HTTP/1.1, reset the stream if HTTP/2.
Also the effect of not reading all data and not closing the stream should probably be documented in an @implNote