RFR: 8371471: HttpClient: Log HTTP/3 handshake failures if logging errors is enabled [v2]
Jaikiran Pai
jpai at openjdk.org
Fri Nov 7 15:03:15 UTC 2025
On Fri, 7 Nov 2025 14:51:32 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Surprisingly if the QUIC handshake fails exceptionally, and `-Djdk.httpclient.HttpClient.log=errors` is specified, the exception is not logged. This change fixes that.
>
> Daniel Fuchs has updated the pull request incrementally with three additional commits since the last revision:
>
> - More copyright dates
> - small test cleanup
> - Fix copyright dates
src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicConnectionImpl.java line 596:
> 594: if (Log.errors()) {
> 595: Log.logError("%s QUIC handshake failed: %s"
> 596: .formatted(logTag(), message(cause)));
I think we don't need the new `message(...)` method here. Perhaps just doing:
Log.logError("%s QUIC handshake failed: %s".formatted(logTag(), cause));
is enough? For example, in jshell I see the following:
jshell> Throwable x = new Throwable()
jshell> Throwable y = new Throwable("foo bar")
jshell> "%s QUIC handshake failed: %s".formatted("tag", x)
$5 ==> "tag QUIC handshake failed: java.lang.Throwable"
jshell> "%s QUIC handshake failed: %s".formatted("tag", y)
$6 ==> "tag QUIC handshake failed: java.lang.Throwable: foo bar"
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28196#discussion_r2504018297
More information about the net-dev
mailing list