Jason918 commented on code in PR #19585:
URL: https://github.com/apache/pulsar/pull/19585#discussion_r1113889704
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -1075,6 +1076,45 @@ private void closeConsumerTasks() {
}
negativeAcksTracker.close();
stats.getStatTimeout().ifPresent(Timeout::cancel);
+ releaseMsgIfEnabledPooledMsg();
+ }
+
+ /**
+ * If enabled pooled messages, we should release the messages after
closing consumer.
+ * 1. Call "clearIncomingMessages" regardless of whether
"internalPinnedExecutor" has shutdown or not.
+ * 2. Increment epoch will auto release all messages which received
after close.
+ * 3. Call "clearIncomingMessages" in "internalPinnedExecutor" is used
to clear messages in flight.
+ */
+ private void releaseMsgIfEnabledPooledMsg() {
Review Comment:
Better not put "if" in the method name.
Suggest to put `if (!poolMessages)` to Line 1079, and keep the method name
like `releaseMsg`
--
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]