Skip to content

Conversation

@ptupitsyn
Copy link
Contributor

@ptupitsyn ptupitsyn commented Dec 31, 2025

  • Handle exceptions in NettyClientMessageHandler to fix "An exceptionCaught() event was fired, and it reached at the tail of the pipeline"
  • Improve logging

https://issues.apache.org/jira/browse/IGNITE-24813

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the logging behavior when the server disconnects from a Java client connection. Previously, when a server closed the connection unexpectedly, exceptions would propagate to DefaultExceptionHandler, which logged them with full stack traces at WARN level. The fix introduces proper exception handling in NettyClientMessageHandler to catch and handle disconnection exceptions gracefully, logging them at DEBUG level instead.

Key changes:

  • Added exceptionCaught handler to NettyClientMessageHandler to capture connection exceptions before they reach the default exception handler
  • Changed onDisconnected parameter type from Exception to Throwable across the connection handling chain for broader exception coverage
  • Moved connection closed logging to the close() method in TcpClientChannel to include exception details in the debug message

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
modules/client/src/main/java/org/apache/ignite/internal/client/io/netty/NettyClientMessageHandler.java Added exceptionCaught method to handle connection exceptions and prevent propagation to default handler; refactored connection retrieval into helper method
modules/client/src/main/java/org/apache/ignite/internal/client/io/netty/NettyClientConnection.java Changed onDisconnected parameter type from Exception to Throwable
modules/client/src/main/java/org/apache/ignite/internal/client/io/ClientConnectionStateHandler.java Updated interface method signature to accept Throwable instead of Exception
modules/client/src/main/java/org/apache/ignite/internal/client/TcpClientChannel.java Moved connection closed logging from onDisconnected to close() method and added exception message to debug log; updated method signatures
modules/client/src/test/java/org/apache/ignite/client/ConnectionTest.java Added test to verify proper logging on server disconnect without exception stack traces
modules/client/build.gradle Added awaitility test dependency for async condition waiting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ptupitsyn ptupitsyn requested a review from isapego January 5, 2026 10:31
@ptupitsyn ptupitsyn merged commit d11e62b into apache:main Jan 5, 2026
5 checks passed
@ptupitsyn ptupitsyn deleted the ignite-24813 branch January 5, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants