RFR: 8305906: HttpClient may use incorrect key when finding pooled HTTP/2 connection for IPv6 address [v4]

Jaikiran Pai jpai at openjdk.org
Wed Jun 7 01:02:48 UTC 2023


> Can I please get a review of this change which proposes to fix the issue reported in https://bugs.openjdk.org/browse/JDK-8305906?
> 
> As noted in that issue, when IPv6 hosts are involved, the HttpClient on certain occasions can end up caching the connection with a key which doesn't match with the key which is then used in a subsequent request against the same target host. 
> 
> The commit in this PR now wraps the IPv6 address in a square bracket consistently so that the correct key is used both during storing the connection in the pool and when looking up.
> 
> A new jtreg test has been added which reproduces this issue without the fix and verifies the fix.

Jaikiran Pai 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 four additional commits since the last revision:

 - Merge latest master branch changes
 - wrapping into brackets is no longer needed
 - use HttpRequestImpl.getAddress() to lookup cache key instead of HttpRequestImpl.getURI()
 - 8305906: HttpClient may use incorrect key when finding pooled HTTP/2 connection for IPv6 address

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13456/files
  - new: https://git.openjdk.org/jdk/pull/13456/files/96b92659..6db0ea8c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13456&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13456&range=02-03

  Stats: 496381 lines in 5623 files changed: 413148 ins; 40702 del; 42531 mod
  Patch: https://git.openjdk.org/jdk/pull/13456.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13456/head:pull/13456

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


More information about the net-dev mailing list