You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/03/24 12:57:04 UTC
[GitHub] [ignite-3] ptupitsyn commented on a change in pull request #749: IGNITE-16725 Thin client: Fix Netty buffer leaks
ptupitsyn commented on a change in pull request #749:
URL: https://github.com/apache/ignite-3/pull/749#discussion_r834277470
##########
File path: modules/client/src/main/java/org/apache/ignite/internal/client/TcpClientChannel.java
##########
@@ -141,7 +146,12 @@ private void close(Exception cause) {
/** {@inheritDoc} */
@Override
public void onMessage(ByteBuf buf) {
- processNextMessage(buf);
+ try {
+ processNextMessage(buf);
+ } catch (Throwable t) {
+ buf.release();
+ throw t;
+ }
Review comment:
When everything goes well, the buffer is released by the `try` block on line 247 after decoding the message. The decoding happens later on `asyncContinuationExecutor`, not on a current thread, so we can't use `finally` here.
But when there is an exception (unexpected message type, unexpected response id, etc) we should release the buffer here to avoid the leak, because full message decoding won't happen.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org