RFR: 8371471: HttpClient: Log HTTP/3 handshake failures if logging errors is enabled [v4]
Daniel Fuchs
dfuchs at openjdk.org
Sat Nov 8 12:46:01 UTC 2025
On Fri, 7 Nov 2025 18:26:04 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Review feedback - request should fail
>
> src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicConnectionImpl.java line 597:
>
>> 595: Log.logError("%s QUIC handshake failed: %s"
>> 596: .formatted(logTag(), cause));
>> 597: Log.logError(cause);
>
> This produces 2 error messages like:
>
> Nov 07, 2025 6:01:57 PM jdk.internal.net.http.quic.QuicConnectionImpl$HandshakeFlow failHandshakeCFs
> INFO: ERROR: QuicServerConnection(1) QUIC handshake failed: java.io.IOException: Connection closed by client peer: CRYPTO_ERROR|certificate_unknown certificate_unknown
> Nov 07, 2025 6:01:57 PM jdk.internal.net.http.quic.QuicConnectionImpl$HandshakeFlow failHandshakeCFs
> INFO: ERROR: java.io.IOException: Connection closed by client peer: CRYPTO_ERROR|certificate_unknown certificate_unknown
> java.io.IOException: Connection closed by client peer: CRYPTO_ERROR|certificate_unknown certificate_unknown
> at java.net.http/jdk.internal.net.http.quic.TerminationCause.toReportedCause(TerminationCause.java:129)
>
> Can we remove the duplicate information? Currently there are 2 timestamps, and the exception message is printed 3 times.
I have considered this. This would require adding a new `logError` metod to `Log`:
public void logError(String msg, Throwable throwable) {
....
}
I refrained from doing that because there may be place where we call logError with a message and a throwable and don't expect to see the stack trace. That would require examining all such call sites and cast the `Throwable` to `Object` - or add a call to toString() - so that they keep on calling `logError(String, Object...)`.
I'd rather do that in a separate cleanup.
FWIW - what you are seeing in the quoted log are a mix of client traces and server traces: the message on the server talks of the `client peer`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28196#discussion_r2506894610
More information about the net-dev
mailing list