Skip to content

Commit 0c64224

Browse files
committed
fix mem leak
1 parent ab90545 commit 0c64224

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -836,15 +836,9 @@ public CompletableFuture<ResponseFuture> invokeImpl(final Channel channel, final
836836
LOGGER.info("Receive go away from channelId={}, channel={}", channel.id(), channel);
837837
ChannelWrapper channelWrapper = RemotingHelper.getAttributeValue(CHANNEL_WRAPPER_ATTRIBUTE_KEY,
838838
channel);
839-
if (channelWrapper != null) {
840-
try {
841-
if (channelWrapper.reconnect(channel)) {
842-
LOGGER.info("Receive go away from channelId={}, channel={}, recreate the "
843-
+ "channelId={}", channel.id(), channel, channelWrapper.getChannel().id());
844-
}
845-
} catch (Throwable t) {
846-
LOGGER.error("Channel {} reconnect error", channelWrapper, t);
847-
}
839+
if (channelWrapper != null && channelWrapper.reconnect(channel)) {
840+
LOGGER.info("Receive go away from channelId={}, channel={}, recreate the channelId={}",
841+
channel.id(), channel, channelWrapper.getChannel().id());
848842
}
849843
if (channelWrapper != null && !channelWrapper.isWrapperOf(channel)) {
850844
RemotingCommand retryRequest = RemotingCommand.createRequestCommand(request.getCode(), request.readCustomHeader());
@@ -1065,6 +1059,8 @@ public boolean reconnect(Channel channel) {
10651059
} else {
10661060
LOGGER.warn("channelWrapper has reconnect, so do nothing, now channelId={}, input channelId={}",getChannel().id(), channel.id());
10671061
}
1062+
} catch (Throwable t) {
1063+
LOGGER.error("ChannelWrapper {} reconnect error", this, t);
10681064
} finally {
10691065
lock.writeLock().unlock();
10701066
}

0 commit comments

Comments
 (0)