Copilot commented on code in PR #1460:
URL: https://github.com/apache/pulsar-client-go/pull/1460#discussion_r2745200837
##########
pulsar/consumer_partition.go:
##########
@@ -1437,6 +1437,11 @@ func (pc *partitionConsumer) MessageReceived(response
*pb.CommandMessage, header
pc.availablePermits.add(skippedMessages)
}
+ if len(messages) == 0 {
+ pc.log.Warnf("receive %d messages , all filtered", numMsgs)
+ return nil
+ }
Review Comment:
Consider adding a unit test to verify this edge case where all messages are
filtered. The test should verify that when all messages in a batch are skipped
(e.g., due to isDuplicate checks), the consumer doesn't panic and the skipped
messages are properly accounted for in availablePermits. This would help
prevent regressions of issue #1454.
--
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]