RFR: JDK-8288746: HttpClient resources could be reclaimed more eagerly

Сергей Цыпанов duke at openjdk.org
Mon Jun 20 18:31:54 UTC 2022


On Mon, 20 Jun 2022 14:09:27 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> Hi,
> 
> Please find here a patch that should help the HttpClient's SelectorManager thread to terminate more timely, allowing the resources consumed by the client to be released earlier.
> 
> The idea is to use a Cleaner registered with the HttpClientFacade to wakeup the Selector when the facade is being gc'ed.
> Some tests have been modified to wait for the selector manager thread to shutdown, and some of them have been observed to timeout when the fix is not in place.

Shouldn't we use `Reference.refersTo()` instead of `Reference.get() == smth` in lines 428 and 501?

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

PR: https://git.openjdk.org/jdk/pull/9217


More information about the net-dev mailing list