mattisonchao commented on code in PR #15852:
URL: https://github.com/apache/pulsar/pull/15852#discussion_r885671147
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ZeroQueueConsumerImpl.java:
##########
@@ -84,11 +84,20 @@ protected Message<T> internalReceive() throws
PulsarClientException {
@Override
protected CompletableFuture<Message<T>> internalReceiveAsync() {
+ // Just being cautious
+ if (incomingMessages.size() > 0) {
+ log.error("The incoming message queue should never be greater than
0 when Queue size is 0");
+ incomingMessages.forEach(Message::release);
+ incomingMessages.clear();
+ }
Review Comment:
@Jason918 Because `internalReceive ` already checks this behaviour, I think
we can remove this check directly.
--
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]