RFR: 8371471: HttpClient: Log HTTP/3 handshake failures if logging errors is enabled [v3]

Daniel Fuchs dfuchs at openjdk.org
Fri Nov 7 18:01:02 UTC 2025


On Fri, 7 Nov 2025 17:01:40 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> test/jdk/java/net/httpclient/http3/H3LogHandshakeErrors.java line 151:
>> 
>>> 149:             System.out.println("Issuing request: " + req1);
>>> 150:             final HttpResponse<Void> resp1 = client.send(req1, BodyHandlers.discarding());
>>> 151:             Assert.assertEquals(resp1.statusCode(), 200, "unexpected response code for GET request");
>> 
>> Sorry I missed htis in the previous round of review. Shouldn't this line be a `fail("Request expected to fail but didn't")`?
>
> Oh sorry I meant to just remove this line. I thought it was better to not configure HTTP_3_URI_ONLY on the request in order to trigger the fallback on TCP. So something might actually respond. If something responds then we could get a response. On the other hand this might impacts other tests that might run on the machine...
> hmmm... maybe I should fix that.

The test now creates a TCP ServerSocket bound to the same port and which will close accepted connections. That should ensure safe fallback on TCP. If the ServerSocket cannot be created (address already in use) then the request will be configured with HTTP3_URI_ONLY to prevent fallback to TCP.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28196#discussion_r2504827168


More information about the net-dev mailing list