Skip to content

Commit 2a3b5b2

Browse files
jeet1995Copilot
andcommitted
Address Copilot review: fix comment accuracy, remove duplicate cause.toString(), update changelog
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fc3fe78 commit 2a3b5b2

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/Http2ParentChannelExceptionHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
5151
// (e.g., TCP RST from LB idle timeout, post-close cleanup).
5252
if (logger.isDebugEnabled()) {
5353
logger.debug(
54-
"Exception on HTTP/2 parent connection [id:{}, activeStreams={}, channelActive={}]: {}",
55-
ctx.channel().id().asShortText(), activeStreams, channelActive, cause.toString(), cause);
54+
"Exception on HTTP/2 parent connection [id:{}, activeStreams={}, channelActive={}]",
55+
ctx.channel().id().asShortText(), activeStreams, channelActive, cause);
5656
}
5757
} else {
5858
// Active streams on a live channel — exception may affect in-flight requests.
5959
logger.warn(
60-
"Exception on HTTP/2 parent connection [id:{}, activeStreams={}, channelActive={}]: {}",
61-
ctx.channel().id().asShortText(), activeStreams, channelActive, cause.toString(), cause);
60+
"Exception on HTTP/2 parent connection [id:{}, activeStreams={}, channelActive={}]",
61+
ctx.channel().id().asShortText(), activeStreams, channelActive, cause);
6262
}
6363
}
6464

sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/ReactorNettyClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ private void configureChannelPipelineHandlers() {
171171
// In H2, doOnConnected fires for stream (child) channels — channel.parent()
172172
// is the TCP connection. The parent pipeline has no ChannelOperationsHandler
173173
// (unlike H1.1), so TCP-level exceptions (RST, broken pipe) propagate to
174-
// Netty's TailContext and get logged as WARN. This handler matches H1.1
175-
// behavior by consuming exceptions at DEBUG level.
174+
// Netty's TailContext. This handler aligns the logging with connection state:
175+
// DEBUG when the parent channel is idle or inactive, WARN when the channel
176+
// is active and in-flight streams may be impacted.
176177
Channel parent = connection.channel().parent();
177178
if (parent != null
178179
&& parent.pipeline().get(Http2ParentChannelExceptionHandler.HANDLER_NAME) == null) {

0 commit comments

Comments
 (0)