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.

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

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

Changes: https://git.openjdk.org/jdk/pull/18840/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18840&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8330572
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/18840.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18840/head:pull/18840

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

Reply via email to