RFR: 8267140: Support closing the HttpClient by making it auto-closable [v11]

Daniel Fuchs dfuchs at openjdk.org
Thu Mar 23 09:20:00 UTC 2023


On Thu, 23 Mar 2023 07:26:32 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Minor updates. Added some links
>>  - Define operations. Clarify some of the things that may stall an orderly shutdown
>
> test/jdk/java/net/httpclient/HttpClientClose.java line 172:
> 
>> 170:         }
>> 171:         if (failed instanceof Exception ex) throw ex;
>> 172:         if (failed instanceof Error e) throw e;
> 
> Is this missing a `client.isTerminated()` assertion here?

The client is created in try-with-resources so we no longer have access to it at this point.
Hmm... Maybe I could create it outside the try-with-resource so that `isTerminated()` can e checked.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13019#discussion_r1145893145


More information about the net-dev mailing list