-
Notifications
You must be signed in to change notification settings - Fork 133
IGNITE-24813 Java client: fix logging on server disconnect #7336
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
Conversation
There was a problem hiding this 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
exceptionCaughthandler toNettyClientMessageHandlerto capture connection exceptions before they reach the default exception handler - Changed
onDisconnectedparameter type fromExceptiontoThrowableacross the connection handling chain for broader exception coverage - Moved connection closed logging to the
close()method inTcpClientChannelto 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.
NettyClientMessageHandlerto fix "An exceptionCaught() event was fired, and it reached at the tail of the pipeline"https://issues.apache.org/jira/browse/IGNITE-24813