Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug logs for http2 stream errors #4515

Merged
merged 3 commits into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import io.netty.handler.codec.http2.Http2ConnectionEncoder;
import io.netty.handler.codec.http2.Http2ConnectionHandler;
import io.netty.handler.codec.http2.Http2Exception;
import io.netty.handler.codec.http2.Http2Exception.StreamException;
import io.netty.handler.codec.http2.Http2Settings;
import io.netty.handler.codec.http2.Http2Stream.State;
import io.netty.handler.codec.http2.Http2StreamVisitor;
Expand Down Expand Up @@ -111,13 +112,20 @@ protected final void onConnectionError(ChannelHandlerContext ctx, boolean outbou

handlingConnectionError = true;
if (Exceptions.isExpected(cause) || isGoAwaySentException(cause, connection())) {
// Ignore silently.
logger.trace("{} HTTP/2 connection error:", ctx.channel(), cause);
} else {
logger.warn("{} HTTP/2 connection error:", ctx.channel(), cause);
}
super.onConnectionError(ctx, outbound, cause, filterHttp2Exception(cause, http2Ex));
}

@Override
protected void onStreamError(ChannelHandlerContext ctx, boolean outbound, Throwable cause,
StreamException http2Ex) {
logger.debug("{} HTTP/2 stream error:", ctx.channel(), cause);
super.onStreamError(ctx, outbound, cause, http2Ex);
}

private static Http2Exception filterHttp2Exception(Throwable cause, @Nullable Http2Exception http2Ex) {
if (http2Ex != null) {
return http2Ex;
Expand Down