RFR: 8308565: HttpClient: Sanitize logging while stopping

Jaikiran Pai jpai at openjdk.org
Tue May 23 07:27:52 UTC 2023


On Mon, 22 May 2023 15:45:57 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> When the HttpClient is stopping many exception stack traces may be logged, in particular if the Http2Connection attempts to send a GOAWAY frame after the underlying TCP connection or the selector have been closed.
> 
> The Http2Connection should look at the Http2ClientImpl state before logging the exception as an error. If the Http2ClientImpl is stopping, a simple debug message should be enough.

These changes look good to me. Good to see that this can improve the situation where there logs would contain distracting exception stacktraces when the client was already shutting down.

src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java line 296:

> 294:     }
> 295: 
> 296:     public boolean stopping() {

Hello Daniel, I think this can be package private, but it's also OK if you want to keep it this way (this class is anyway an internal class in the `java.net.http` module)

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

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14089#pullrequestreview-1438842533
PR Review Comment: https://git.openjdk.org/jdk/pull/14089#discussion_r1201670807


More information about the net-dev mailing list