RFR: 8292381: java/net/httpclient/SpecialHeadersTest.java fails with "ERROR: Shutting down connection: HTTP/2 client stopped"
Jaikiran Pai
jpai at openjdk.org
Thu Aug 18 06:45:14 UTC 2022
On Wed, 17 Aug 2022 17:06:12 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
> Please find here a change that improves SpecialHeadersTest. This test creates a large amount of ephemeral clients and has been observed running out of heap space in our CI once. This change updates the test to wait for the previous HttpClient to be eligible for garbage collection before it creates a new one. It also verifies that no outstanding operation are still running on the client by the time the client is released.
test/jdk/java/net/httpclient/HttpServerAdapters.java line 113:
> 111: if (this == o) return true;
> 112: if (!(o instanceof HttpTestRequestHeaders headers)) return false;
> 113: return Objects.equals(entrySet(), headers.entrySet());
This code confused me a bit initially. Each of the subclasses of `HttpTestRequestHeaders` has a `headers` private member and I misread this line to be comparing the headers entrySet with itself. Would it be better if we renamed this local variable (in the instanceof line above) to `otherHeaders` to avoid any confusion?
-------------
PR: https://git.openjdk.org/jdk/pull/9908
More information about the net-dev
mailing list