Skip to content

Commit d68fa5c

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 236be78 commit d68fa5c

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

sdk/cosmos/azure-cosmos/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Fixed JVM `<clinit>` deadlock when multiple threads concurrently trigger Cosmos SDK class loading for the first time. - See [PR 48689](https://github.com/Azure/azure-sdk-for-java/pull/48689)
1313
* Fixed an issue where `CustomItemSerializer` was incorrectly applied to internal SDK query pipeline structures (e.g., `OrderByRowResult`, `Document`), causing deserialization failures in ORDER BY, GROUP BY, aggregate, DISTINCT, and hybrid search queries. - See [PR 48811](https://github.com/Azure/azure-sdk-for-java/pull/48811)
1414
* Fixed an issue where `SqlParameter` ignored the configured `CustomItemSerializer`, always using the internal default serializer instead. - See [PR 48811](https://github.com/Azure/azure-sdk-for-java/pull/48811)
15-
* Fixed Netty WARN log "An exceptionCaught() event was fired, and it reached at the tail of the pipeline" appearing on HTTP/2 connections when the server resets idle TCP connections. Added an exception handler on the HTTP/2 parent channel to consume connection-level exceptions at DEBUG level, matching HTTP/1.1 behavior. - See [PR 48687](https://github.com/Azure/azure-sdk-for-java/pull/48687)
15+
* Fixed an issue where Netty could log "An exceptionCaught() event was fired, and it reached at the tail of the pipeline" on HTTP/2 connections when the server resets idle TCP connections by adding an exception handler on the HTTP/2 parent channel to handle these connection-level exceptions more appropriately. - See [PR 48890](https://github.com/Azure/azure-sdk-for-java/pull/48890)
1616

1717
#### Other Changes
1818

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)