zymap commented on code in PR #4289:
URL: https://github.com/apache/bookkeeper/pull/4289#discussion_r1566968073
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java:
##########
@@ -1211,10 +1214,14 @@ private void writeAndFlush(final Channel channel,
nettyOpLogger.registerFailedEvent(MathUtils.elapsedNanos(startTime),
TimeUnit.NANOSECONDS);
}
});
+ calledWrite = true;
channel.writeAndFlush(request, promise);
} catch (Throwable e) {
LOG.warn("Operation {} failed",
StringUtils.requestToString(request), e);
errorOut(key);
+ if (!calledWrite) {
Review Comment:
This is a little weird. I think this catch wants to catch the channel is
null for some reason. That means we may forget to release if the channel is
null at line 1218. As I understand, if the request goes into the writeAndFlush,
it should be handled well by Netty. So all the exceptions we get here, we can
release the request.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]