If Http2ClientImpl::stop() is called, it will loop through the connections map and call the close() method on each connection. The changes in this PR make sure that the connection thread (where close is called from) removes the `Http2Connection` from the connection pool to prevent inactive connections from remaining in there rather than just closing it.
Even though the connection can be and usually is removed from the pool in other places (reader or writer thread), this change ensures removal from the pool in cases where the connection is shutdown by an exception, reset, etc. The issue was first spotted when a RST_STREAM triggered repeated attempts to remove idle connections from the pool before a regular shutdown could occur. ------------- Commit messages: - 8318492: Http2ClientImpl should attempt to close and remove connection in stop() Changes: https://git.openjdk.org/jdk/pull/16340/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16340&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8318492 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/16340.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/16340/head:pull/16340 PR: https://git.openjdk.org/jdk/pull/16340
