mattisonchao commented on code in PR #19585:
URL: https://github.com/apache/pulsar/pull/19585#discussion_r1113803676


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -1075,6 +1075,13 @@ private void closeConsumerTasks() {
         }
         negativeAcksTracker.close();
         stats.getStatTimeout().ifPresent(Timeout::cancel);
+        // Execute "clearIncomingMessages" regardless of whether 
"internalPinnedExecutor" has shutdown or not.
+        // Call "clearIncomingMessages" in "internalPinnedExecutor" is used to 
clear messages in flight.
+        if (!internalPinnedExecutor.isShutdown()) {
+            internalPinnedExecutor.execute(this::clearIncomingMessages);
+        } else {
+            clearIncomingMessages();

Review Comment:
   If the `executor` has shutdown, it is still running some task in background. 



-- 
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]

Reply via email to