RFR: 8330572: jdk.internal.net.http.HttpConnection calls an expensive checkOpen() when returning a HTTP/1.1 connection to the pool

Daniel Fuchs dfuchs at openjdk.org
Thu Apr 18 14:36:03 UTC 2024


On Thu, 18 Apr 2024 13:47:04 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which proposes to fix the issue reported in https://bugs.openjdk.org/browse/JDK-8330572?
> 
> As noted in that issue, the internal method `checkOpen()` should only be called when picking a non-TLS HTTP/1.1 connection from the pool and before handing it out. That method should not be called in any other places.
> 
> The commit in this PR addresses that by removing the call to `checkOpen()` when the connection is being returned back to the pool. The `checkOpen()` call which does a socket channel read is now replaced with a `isOpen()` call which is just a state check.
> 
> Existing tests in tier2 continue to pass with this change. A test repeat of 50 of test/jdk/java/net/httpclient tests too passes without any regressions. No new test has been added given the nature of this change.

Looks good to me. Please verify that existing tests are still stable.

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

Marked as reviewed by dfuchs (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18840#pullrequestreview-2009088892


More information about the net-dev mailing list