RFR: 8257736: InputStream from BodyPublishers.ofInputStream() leaks when IOE happens [v3]

Yasumasa Suenaga ysuenaga at openjdk.java.net
Fri Dec 11 02:22:55 UTC 2020


On Thu, 10 Dec 2020 10:13:01 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> test/jdk/java/net/httpclient/StreamCloseTest.java line 37:
>> 
>>> 35:  * @compile ../../../com/sun/net/httpserver/FileServerHandler.java
>>> 36:  * @build jdk.test.lib.net.SimpleSSLContext
>>> 37:  * @build LightWeightHttpServer
>> 
>> It would be preferable to avoid the use of LightWeightHttpServer in this test. The server-side seems trivial enough to implement locally in the test.
>
> I agree with Chris. In addition it will make it possible to check that the server either doesn't receive the request, or get an exception when it tries to read the body bytes.

I updated testcase not to use `LightWeightHttpServer`.

This test is for `HttpClient`, and HTTP server might work in undefined behavior if the error happens in client side (I guess it would be handled as an error in most case). So this test does not check request headers/body from the client.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1614


More information about the net-dev mailing list