RFR: 8376118: java/net/httpclient/StreamingBody.java fails intermittently on Windows [v4]

Daniel Fuchs dfuchs at openjdk.org
Fri Jan 23 12:21:54 UTC 2026


On Fri, 23 Jan 2026 08:53:25 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review feedback
>
> test/jdk/java/net/httpclient/StreamingBody.java line 151:
> 
>> 149:         private final Thread runner;
>> 150:         private volatile boolean stop;
>> 151:         private final Random RANDOM = RandomFactory.getRandom();
> 
> 1. This can be `static`
> 2. Doesn't this warrant a `@key randomness`?

Done.

> test/jdk/java/net/httpclient/StreamingBody.java line 228:
> 
>> 226:                         .join();
>> 227: 
>> 228:                 String body = new String(response.body().readAllBytes(), UTF_8);
> 
> AFAIU, we use an `HttpResponse<InputStream>` and convert it to string _after_ the `HttpResponse` instantiation, instead of directly reaching for `HttpResponse<InputStream>`, because the former does not immediately finalize the request. This creates better odds to leak resources, which we're trying to stress in this test. Assuming my interpretation is correct, you might consider dropping a comment briefly explaining this rationale.

Done

> test/jdk/java/net/httpclient/StreamingBody.java line 300:
> 
>> 298:         out.println("\n=========================");
>> 299:         try {
>> 300:             out.printf("%n%sCreated %d servers and %d clients%n",
> 
> *Nit:* You might consider using `%s` instead of `%d`, since the latter renders numbers in localized form, and can produce surprising outputs. (@dfuch, this was a nice lesson I learned from you. 🙏)

done

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29366#discussion_r2720976934
PR Review Comment: https://git.openjdk.org/jdk/pull/29366#discussion_r2720978760
PR Review Comment: https://git.openjdk.org/jdk/pull/29366#discussion_r2720973799


More information about the net-dev mailing list