RFR: 8316580: HttpClient with StructuredTaskScope does not close when a task fails [v3]

Daniel Fuchs dfuchs at openjdk.org
Tue Sep 26 15:02:51 UTC 2023


On Tue, 26 Sep 2023 08:24:29 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>> 
>>  - Rename test, use TestTaskScope
>>  - Make the test independent of any preview API, and use regular threads
>>  - Improve the fix to make sure dependent actions are all executed
>>  - Merge branch 'master' into HttpGetWithCancelledStructuredScope-8316580
>>  - Merge branch 'master' into HttpGetWithCancelledStructuredScope-8316580
>>  - 8316580
>
> src/java.net.http/share/classes/jdk/internal/net/http/MultiExchange.java line 405:
> 
>> 403:             // make sure to fail with CancellationException if cancel(true)
>> 404:             // was called.
>> 405:             t = cancellationException(t);
> 
> What's the reason for this change?

Drive by fix - you can set initCause only once - so it's better to actually reconstruct the CancellationException when setting its cause.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15883#discussion_r1337354193


More information about the net-dev mailing list